Hell Templar Posted December 1, 2005 Share Posted December 1, 2005 I have been working with a tutorial, attempting to create a script so I create a riddle chest/Door. You try to open it and if you get the wrong answer a spell goes off. However I seem to be running into a problem. The script is below... Begin 666_Krag_Riddle_Chest Short ControlvarShort ButtonFloat Timer If ( MenuMode == 1 ) ReturnEndif If ( OnActivate == 1 )If ( Controlvar == 0 ) MessageBox "I have two Arms, Two Legs, Two Eyes and one thousand heads, what am I?", "A Farmer", "A Man selling Cabbage", "A Teacher", "A King"Set Controlvar to 1Elseif Controlvar > 1 Activate endifendif endifendifif ( controlvar == 1 ) set button to GetButtonPressed if ( button == -1 ) return elseif ( button == 2 ) MessageBox "Your answer is correct." Activate set Controlvar to 2 else MessageBox "Your answer is incorrect!" Player -> Addspell, "Frost_Curse" set controlvar to -1 endifelseif ( controlvar == 2 ) Activate Set controlvar to 3elseif ( controlvar == -1 ) set timer to ( timer + GetSecondsPassed ) if timer > 10 player -> RemoveSpell, "Frost_Curst set controlvar to -2 endifendif End Link to comment Share on other sites More sharing options...
Marxist ßastard Posted December 1, 2005 Share Posted December 1, 2005 "OMG CURST OEF COLD!!!11!" is a spell, range touch, that deals cold damage over the duration of ten seconds. begin "OMG RUDDLE CHEESET!One1.lsc" short sc short btn if ( menumode ) return elseif ( onactivate ) if ( sc == 0 ) messagebox "I have two arms, two legs, two eyes, and one thousand heads -- what am I?", "A farmer", "A man selling cabbage", "A teacher", "A king" set sc to 1 elseif ( sc > 1 ) activate ; Comment out the next two lines if you want the PC to be punished only ; once for getting the wrong answer elseif ( sc < 0 ) cast "OMG CURST OEF COLD!!!11!" player endif elseif ( sc == 1 ) set btn to getbuttonpressed ; Buttons start at 0, so second answer is 1 if ( btn == 1 ) messagebox "Your answer is correct." activate set sc to 2 elseif ( btn > -1 ) messagebox "Your answer is incorrect!" cast "OMG CURST OEF COLD!!!11!" player set sc to -1 endif endif end Link to comment Share on other sites More sharing options...
Gabbemaster Posted December 1, 2005 Share Posted December 1, 2005 "OMG CURST OEF COLD!!!11!" Eh... Sorry to say this, but I think you spelled something wrong there... It is supposed to be; "OMG CURST OEF TEH COLD!!!11!" You have to be carefull not to spell things wrong, some people wont understand what you are trying to say, if you forget those important parts... :rolleyes: ;) Link to comment Share on other sites More sharing options...
Hell Templar Posted December 1, 2005 Author Share Posted December 1, 2005 "OMG CURST OEF COLD!!!11!" Eh... Sorry to say this, but I think you spelled something wrong there... It is supposed to be; "OMG CURST OEF TEH COLD!!!11!" You have to be carefull not to spell things wrong, some people wont understand what you are trying to say, if you forget those important parts... :rolleyes: ;) Well so far so good, seems to work perfectly. I had to fumble through a fw things to gt it working exactly the way I needed it, but it looks good. Thanx for all the help. Link to comment Share on other sites More sharing options...
Wookiee Posted December 2, 2005 Share Posted December 2, 2005 take out the menumode break and put in a state conditional edit: ohhhhh 666th post :) Link to comment Share on other sites More sharing options...
Marxist ßastard Posted December 2, 2005 Share Posted December 2, 2005 The menumode break doesn't do anything detrimental, and stops stray clicks on the container while in menu mode from registering. The script already keeps track of its state. Link to comment Share on other sites More sharing options...
Wookiee Posted December 2, 2005 Share Posted December 2, 2005 lol not from yours mb from his original :) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.