-- Define the status of each cheat isOn = '[ON] ' isOff = '[OFF] ' chStatus = {isOff, isOff, isOff} -- Function to toggle the status of a cheat function Status(cheat) if chStatus[cheat] == isOn then chStatus[cheat] = isOff else chStatus[cheat] = isOn end end -- Function to display the main menu function Main(rMenu) if rMenu == 0 then gg.setVisible(true) while true do if gg.isVisible() then gg.setVisible(false) local menu = gg.choice({ chStatus[1] .. 'Cheat One', chStatus[2] .. 'Cheat Two', chStatus[3] .. 'Cheat Three', '\n\nEXIT', }, nil) if menu == 1 then Status(1) Main(0) elseif menu == 2 then Status(2) Main(0) elseif menu == 3 then Status(3) Main(0) elseif menu == 4 then gg.toast("Exiting...") os.exit() end end gg.sleep(100) end elseif rMenu == 1 then -- Sub menu for Player options while true do gg.setVisible(true) if gg.isVisible() then gg.setVisible(false) local pMenu = gg.choice({ 'Godmode', 'Speedhack', '\n\nRETURN' }, nil, 'Player Menu') if pMenu == 1 then -- Code for Godmode gg.alert("God Mode ON") Main(1) elseif pMenu == 2 then -- Code for Speedhack gg.alert("Speed Hack ON") Main(1) elseif pMenu == 3 then rMenu = 0 Main(0) end end gg.sleep(100) end -- Define more sub-menus as needed -- ... end end -- Start the main menu Main(0)