Umm so guys I ran into an issue while creating a script. Here's an example of the script
function doSomething()
does something
end
function main()
local option = gg.prompt('High damage')
if option == 1 then
doSomething()
goto START
end
end
gg.setVisible(false)
::START::
while true do
if gg.isVisible() then
gg.setVisible(false)
main()
end
gg.sleep(100)
end
Basically what i want it to do is check for icon being pressed...when the icon is pressed it runs the main menu, and then when someone chooses a main menu option high damage for example it does something but I don't want the script to end I want it to go back to waiting for the icon to be pressed. I need this because after the high damage thing it needs to wait for the user to do something in game and then go back to the script.
I know this is possible as I've seen it happen in many different scripts before but I don't know how to do it. And I'd appreciate the help. If this isn't possible is there at least a way for the script to restart itself? Thanks in advance guys.
I tried it like the method I showed above but it gave me an error saying there is no start label visible in the main() function which makes sense since I'm calling START before it's defined but I don't know how to solve this problem
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Question
Mofo50
Umm so guys I ran into an issue while creating a script. Here's an example of the script
function doSomething()
does something
end
function main()
local option = gg.prompt('High damage')
if option == 1 then
doSomething()
goto START
end
end
gg.setVisible(false)
::START::
while true do
if gg.isVisible() then
gg.setVisible(false)
main()
end
gg.sleep(100)
end
Basically what i want it to do is check for icon being pressed...when the icon is pressed it runs the main menu, and then when someone chooses a main menu option high damage for example it does something but I don't want the script to end I want it to go back to waiting for the icon to be pressed. I need this because after the high damage thing it needs to wait for the user to do something in game and then go back to the script.
I know this is possible as I've seen it happen in many different scripts before but I don't know how to do it. And I'd appreciate the help. If this isn't possible is there at least a way for the script to restart itself? Thanks in advance guys.
I tried it like the method I showed above but it gave me an error saying there is no start label visible in the main() function which makes sense since I'm calling START before it's defined but I don't know how to solve this problem
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.