Jump to content

A lavatory script problem.


MtB

Recommended Posts

I'm attempting at create a real lavatory that would not be out of place in the Tenpenny Tower. Something, however, is wrong. When the player activates the toilet, a pop up box offers three options to choose from; they being pee, poop, and drink. For both pee and poop a sound effect is played that represents the action bring undertaken. By selecting the drink option the player is supposed to activate the lavatory as normal (as though it was never scripted), however, as the animation plays the sound effect for the pee option also plays - which it should not. This is my script...

 

 

ScriptName aaWorkingToiletScript

 

; This script creates a lavatory which offers the player three uses. Those uses

; being Pee, Poop, and Drink.

 

Short button

 

Begin OnActivate

ShowMessage aaWorkingToiletMSG

End

 

 

Begin GameMode

Set button to GetButtonPressed

If ( button == 0 )

PlaySound aaPee

 

ElseIf ( button == 1)

PlaySound aaPoop

 

ElseIf ( button == 2)

ShowMessage aaEwwwwGrossMSG

Activate

EndIf

EndIf

EndIf

End

Link to comment
Share on other sites

Try this instead, you also had one too many EndIfs...

 

 

ScriptName aaWorkingToiletScript

; This script creates a lavatory which offers the player three uses. Those uses
; being Pee, Poop, and Drink.

Short button
Short IsOn

Begin onactivate
   ShowMessage aaWorkingToiletMSG
   Set IsOn to 1
End


Begin GameMode
  If (IsOn)
     Set button to GetButtonPressed
     If ( button == 0 )
        PlaySound aaPee
     ElseIf ( button == 1)
        PlaySound aaPoop
     ElseIf ( button == 2)
        ShowMessage aaEwwwwGrossMSG
        Activate
     EndIf
     Set IsOn to 0
  EndIf
End 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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