Hey, i’m getting some trouble trying to make a godmode on/off button using the menu.
local playerPed = GetPlayerPed(-1)
local godmode = false
WarMenu.CreateMenu('test', 'ADM')
WarMenu.CreateSubMenu('closeMenu', 'test', 'Are you sure?')
while true do
if WarMenu.IsMenuOpened('test') then
if WarMenu.CheckBox('Checkbox', checkbox, function(checked)
end) then
-- Do your stuff here
elseif WarMenu.MenuButton('God Mode', 'test') then
drawNotification('God Mode:~g~ON')
SetEntityInvincible(GetPlayerPed(-1), (godmode == false))
SetPlayerInvincible(PlayerId(), (godmode == false))
local godmode = true
i want to turn the godmode OFF using the same button, wha’ts wrong here? I can enablethe godmode but i cant disable i’m sorry if it’s something stupid, just started messing around with this.