QUOTE(lordneverar @ Jun 14 2008, 12:40 AM)

im making a message box choice where you click on ether "yes" or "no" but whenever I go to save the script it says "button" is an invalid variable.
here is my script if it will help any...
scn LORDtheonering10unequip
Begin OnActivate
Messagebox "Do you wish to take off the One Ring?", "Yes", "No"
Set button to GetButtonPressed
If ( button == -1 )
Return
ElseIf ( button == 2)
MessageBox "You take the ring off."
Setstage theringofpower 20
Else
MessageBox "You leave the ring on."
EndIf
EndIf
End
Even without trying understanding the complete logic ... as it is this script don't even compiles and the reason is said in the message. Button is not 'defined' as variable ... define it as short and the this problem is gone.
Yet the logic is strange... The test is wrong. getbuttonpressed returns 0 to the first one, 1 to the second.... and -1 if none, you never get 2 there.
Since messagebox stop time the -1 is better used to force it being presented again (if some other message box overlap it, for example)
PS edit: You are advised reading a bit more about name conventions and some others little things, in a little mod may not be problem, but in larger projects you get lost quickly and easily.