Platonic Posted June 27, 2018 Posted June 27, 2018 hey guys I tried making a ON/OFF button in one...please take a look at the script...there is also a video part of it, how I made it and stuff like that but It seems the video is not that clear, that's why I give ya guys the file of that script in case you want to see how I made it or to improve it or stuff like that, please if you have improve the script, let me know I would like to see a better way. thanks guys https://www.youtube.com/watch?v=5j2DQOoxhIc&t=90s tutorial.lua
RCPOLSKI Posted August 3, 2018 Posted August 3, 2018 Nice one... But there is a easy way to do this and have the "ON" and "OFF" in the same button -- testing if gg.isVisible(true) then gg.setVisible(false) end status = 0 on = 'turn off' off = 'turn on' function menu() if status == 0 then gg.choice({off,'exit'}, 'Want to turn the option on?') if choice == 1 then status = 1 menu() else os.exit() end else gg.choice({on,'exit'}, 'Want to turn the option off?') if choice == 1 then status = 0 menu() else os.exit() end end end menu() Ofc you don't need to make the vars U can simple write it right after the gg.choice gg.choice('turn on', 'exit') --and then gg.choice('turn off','exit') Anyways, thx for helping the community!
Platonic Posted August 15, 2018 Author Posted August 15, 2018 On 8/3/2018 at 3:00 AM, RCPOLSKI said: Nice one... But there is a easy way to do this and have the "ON" and "OFF" in the same button -- testing if gg.isVisible(true) then gg.setVisible(false) end status = 0 on = 'turn off' off = 'turn on' function menu() if status == 0 then gg.choice({off,'exit'}, 'Want to turn the option on?') if choice == 1 then status = 1 menu() else os.exit() end else gg.choice({on,'exit'}, 'Want to turn the option off?') if choice == 1 then status = 0 menu() else os.exit() end end end menu() Ofc you don't need to make the vars U can simple write it right after the gg.choice gg.choice('turn on', 'exit') --and then gg.choice('turn off','exit') Anyways, thx for helping the community! Thx alot buddy
RCPOLSKI Posted August 25, 2018 Posted August 25, 2018 On 8/15/2018 at 12:42 AM, XxhentaixX said: Thx alot buddy If u want, take a look at this post... It has a complete guide to set ON or OFF directly in the button on the menu window Prefix buttons (ON and OFF) (#9r34288j)
YeetMeister Posted September 7, 2018 Posted September 7, 2018 On 8/3/2018 at 3:00 AM, RCPOLSKI said: Nice one... But there is a easy way to do this and have the "ON" and "OFF" in the same button -- testing if gg.isVisible(true) then gg.setVisible(false) end status = 0 on = 'turn off' off = 'turn on' function menu() if status == 0 then gg.choice({off,'exit'}, 'Want to turn the option on?') if choice == 1 then status = 1 menu() else os.exit() end else gg.choice({on,'exit'}, 'Want to turn the option off?') if choice == 1 then status = 0 menu() else os.exit() end end end menu() Ofc you don't need to make the vars U can simple write it right after the gg.choice gg.choice('turn on', 'exit') --and then gg.choice('turn off','exit') Anyways, thx for helping the community! Im a Bit Comfused rn... where do i add the Functions. Can you show it with a gg.toast() ? Thank you
Recommended Posts
Archived
This topic is now archived and is closed to further replies.