ScriptSpot

Forum topic · General Scripting

Why does this simple utility script produce errors?

By crookz · 2009-02-25

Description

Hi, Im just starting out with maxscript. Can someone explain to me why this utility script produces errors when ran:

utility drawBox "Draw a Box :D"
(
newsox = box width:20 length:20 height:20
)

error:
-- Syntax error: at =, expected name
-- In line: newsox = b

any help i can get to understand this simple bit of code would be fantstic!!

Thanks

Comments (1)

Anubis · 2009-03-04

utility drawBox "Draw a Box :D"
(
	-- then close utility
	on drawBox close do
	(
		newsox = box width:20 length:20 height:20
	)
) -- ie need action to create a box

OR...

utility drawBox "Draw a Box :D"
(
	local newsox
	
	button myBtn "Create"
	
	on myBtn pressed do
	(
		newsox = box width:20 length:20 height:20
	)
)