Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Multiple MessageBox Help


Rizalgar
 Share

Recommended Posts

Ok I'm taking a shot in the dark since this forum doesn't seem very active. I need help with a script. It's a multiple dialog box script that summons enemies. Basically my problem is that no matter with MessageBox I'm in, the Buttons always act as if they're in Box 1. Here's the script.

Begin _trainingbackup


Short ScriptState

Short Button


If ( MenuMode == 1 )

Return

EndIf


If ( OnActivate == 1 )

If ( ScriptState == 0 )

MessageBox "What would you like to summon?" "Scrib - Level 1 | 20 Gold" "Rat - Level 2 | 35 Gold" "Kwama Warrior - Level 3 | 45 Gold" "Bonewalker - Level 4 | 70 Gold" "Scamp - Level 5 | 75 Gold" "Next"

Set ScriptState to 0

EndIf

EndIf


If ( ScriptState == 0 )

Set Button to GetButtonPressed

If ( Button == 0 )

If ( Player->GetItemCount Gold_001 < 20 )

MessageBox "You don't have enough gold"

Else

Player->RemoveItem "Gold_001" 20

MessageBox "You summon a level 1 Scrib."

PlaceAtPC "scrib", 1, 128, 3

Set ScriptState to 1

EndIf

EndIf

If ( Button == 1 )

If ( Player->GetItemCount Gold_001 < 35 )

MessageBox"You don't have enough gold."

Else

Player->RemoveItem "Gold_001" 35

MessageBox "You summon a level 2 Rat."

PlaceAtPC "Rat", 1, 128, 3

Set ScriptState to 1

EndIf

EndIf

If ( Button == 2 )

If ( Player->GetItemCount Gold_001 < 45 )

MessageBox "You don't have enough gold."

Else

Player->RemoveItem "Gold_001" 45

MessageBox "You summon a level 3 Kwama Warrior"

PlaceAtPC "kwama warrior", 1, 128, 3

Set ScriptState to 1

EndIf

EndIf

If ( Button == 3 )

If ( Player->GetItemCount Gold_001 < 70 )

MessageBox "You don't have enough gold."

Else

Player->RemoveItem "Gold_001" 70

MessageBox "You summon a level 4 Bonewalker."

PlaceAtPC "bonewalker", 1, 128, 3

Set ScriptState to 1

EndIf

EndIf

If ( Button == 4 )

If ( Player->GetItemCount Gold_001 < 75 )

MessageBox "You don't have enough gold."

Else

Player->RemoveItem "Gold_001" 75

MessageBox "You summon a level 5 Scamp."

PlaceAtPC "scamp", 1, 128, 3

Set ScriptState to 1

EndIf

EndIf

If ( Button == 5 )

Set ScriptState to 3

EndIf

EndIf


If ( ScriptState == 3 )

Set Button to GetButtonPressed

MessageBox "Levels Six through Ten" "Shalk - Level 6 | 60 Gold" "Skeleton Warrior - Level 7 | 110 Gold"

If ( Button == 0 )

If (Player->GetItemCount Gold_001 < 60 )

MessageBox "You don't have enough gold."

Else

Player->RemoveItem "Gold_001" 60

MessageBox "You summon a level 6 Shalk."

PlaceAtPc "shalk", 1, 128, 3

Set ScriptState to 3

EndIf

EndIf

If ( Button == 1 )

If ( Player->GetItemCount Gold_001 < 110 )

MessageBox "You don't have enough gold."

Else

Player->RemoveItem "Gold_001" 110

MessageBox "You summon a level 7 Skeleton Warrior"

PlaceAtPC "skeleton warrior", 1, 128, 3

Set ScriptState to 3

EndIf

EndIf

EndIf


If ( ScriptState == 1 )

Set ScriptState to 0

EndIf


If ( ScriptState == 3 )

Set ScriptState to 0

EndIf


End _trainingbackup

 

Edited by InsanitySorrow
Added Code Tag
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...