Post new topic    
King Slime
Send private message
Tag Setting Variables 
 PostThu Sep 15, 2011 7:52 pm
Send private message Reply with quote
I'm working on a script that randomly sets a choice of five tags on or off. But, it will not compile. It says an extra begin in it. Heres the script.

Code:
plotscript, merchant tags, begin
   variable(merchant)
   set variable(merchant,random(1,15)
   
   if (merchant == 1) then (set tag(26,ON)
   if (merchant == 2) then (set tag(27,ON)
   if (merchant == 3) then (set tag(28,ON)
   if (merchant == 4) then (set tag(29,ON)
   if (merchant == 5) then (set tag(30,ON)
   if (merchant == 6) then (set tag(26,OFF)
   if (merchant == 7) then (set tag(27,OFF)
   if (merchant == 8) then (set tag(28,OFF)
   if (merchant == 9) then (set tag(29,OFF)
   if (merchant == 10) then (set tag(30,OFF)
   
   end   


Can you stop what is wrong?
Metal King Slime
Send private message
 
 PostThu Sep 15, 2011 7:55 pm
Send private message Reply with quote
setvariable (merchant,random(1,15)

should be

setvariable (merchant,random(1,15))

and actually, it looks like every settag is msising a ) too
Super Slime
Send private message
 
 PostThu Sep 15, 2011 9:49 pm
Send private message Reply with quote
Remember that ( and ) are exactly the same as begin and end, respectively. If you're not using an editor that does parenthesis matching, you should switch now. Notepad++ is an excellent editor.
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Display posts from previous: