Jump to content

Photo

[Script] Help with message boxes

scripting

  • Please log in to reply
2 replies to this topic

#1
wmmitchell

wmmitchell

    Stranger

  • Premium Member
  • 7 posts

Hello I am working on a script for my ammo swap mod. What I want it to do is initially prompt a message, then based off the selection of the first message prompt one of two other messages. This is what it looks like:

Spoiler

 

I get the error "function variable ButtonPressed may not shadow a previously defined variable". As a workaround I just made one super long message with 20 selections but that isn't really ideal as it feels clunky. 

I am fairly novice when it comes to scripting and am still trying to teach myself things. Any help would be appreciated.

 


#2
RaidersClamoring

RaidersClamoring

    Fan

  • Premium Member
  • 266 posts

Just remove the "Int" from "int ButtonPressed = V_50Ammo.show()" and you will get rid of that message. That's what it means by "shadowing", declaring it twice.



#3
wmmitchell

wmmitchell

    Stranger

  • Premium Member
  • 7 posts

Just remove the "Int" from "int ButtonPressed = V_50Ammo.show()" and you will get rid of that message. That's what it means by "shadowing", declaring it twice.

 

Thank you that worked! I figured it was probably something simple.







Also tagged with one or more of these keywords: scripting

IPB skins by Skinbox
Page loaded in: 1.167 seconds