помогите со скриптом

qqware

Участник
Автор темы
44
2
Версия SA-MP
  1. Другая
lua:
local imgui = require 'mimgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
local u8 = encoding.UTF8
require 'widgets'
local sf = require 'sampfuncs'

local WinState = imgui.new.bool()

imgui.OnFrame(function() return WinState[0] end, function(player)
    imgui.SetNextWindowPos(imgui.ImVec2(500, 500), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
    imgui.SetNextWindowSize(imgui.ImVec2(245, 280), imgui.Cond.Always)
    imgui.Begin(u8'��������', WinState, imgui.WindowFlags.NoResize)
    if imgui.BeginTabBar('Tabs') then
    
        if imgui.BeginTabItem(u8'�����') then
        
            
            if imgui.Button('GM', GodMode.enabled) then
            
          if GodModePed.enabled[0] then
          
            GodMode.activate()
            
          else
          
            GodMode.reset()
            
                      end
          
              end
             if imgui.Button(u8'������') then
          setCharHealth(PLAYER_PED, 0)     end
                imgui.EndTabItem()           
    end     
         if imgui.BeginTabItem(u8'�����') then
          
             imgui.Text(u8'@qqware')
          
                end
                
            imgui.EndTabItem()
      
           end
          
        imgui.EndTabBar()
 
      end)
    
    imgui.End()
 


--godmode
local GodMode = {
  enabled = imgui.new.bool(false)
}

GodMode.activate = function()
  setCharProofs(PLAYER_PED, false, true, true, true, true)

  lua_thread.create(function()
    while GodMode.enabled[0] do
      wait(0)
      setCharProofs(PLAYER_PED, false, true, true, true, true)
    end
  end)
end

GodMode.reset = function()
  setCharProofs(PLAYER_PED, false, false, false, false, false)
end

function main()
    sampRegisterChatCommand('pon', function() WinState[0] = not WinState[0] end)
    wait(-1)
      end
мобайл мунлоадер
attempt to index global 'GodMode' (a nil value)
stack traceback:
/lua cheT.lua:20: in function '_draw'
lib/mimgui/init.lua:100: in function <./lib/mimgui/init.lua:84>
как починить