Jump to content

Script Trouble


Hell Templar

Recommended Posts

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 Controlvar

Short Button

Float Timer

 

If ( MenuMode == 1 )

Return

Endif

 

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 1

Elseif Controlvar > 1

Activate

 

endif

endif

 

endif

endif

if ( 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

endif

elseif ( controlvar == 2 )

Activate

Set controlvar to 3

elseif ( controlvar == -1 )

set timer to ( timer + GetSecondsPassed )

if timer > 10

player -> RemoveSpell, "Frost_Curst

set controlvar to -2

endif

endif

 

End

Link to comment
Share on other sites

"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

"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

"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

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...