Почему текст появляется на мгновение и сразу исчезает?

mills.

Известный
Автор темы
26
0
Версия MoonLoader
.025-beta
Как сделать так, чтобы он остался на бесконечное время, до того как я заново активирую кнопку?

Lua:
s
script_name "Universal scripts Monser DM"

require "lib.moonloader"

local vehicle = 411
local font_flag = require('moonloader').font_flag
local my_font = renderCreateFont('Verdana', 12, font_flag.BOLD + font_flag.SHADOW)
local time

function main()
  if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable do wait(100) end
  while true do
    wait(0)
    if not sampIsChatInputActive() then
      if isKeyJustPressed(VK_R) then
        sampSendChat("/anim 8")
              wait(200)
              setVirtualKeyDown(VK_SPACE, true)
        wait(100)
        setVirtualKeyDown(VK_SPACE, false)
       end
      if isKeyJustPressed(VK_E) then
        sampSendChat("/veh "..vehicle.." 126 126")
       end
             if isKeyJustPressed(VK_X) then
         sampSendChat("/heal")
                 wait(5000)
                 renderFontDrawText(my_font, 'МОЖНО ИСПОЛЬЗОВАТЬ', 1550, 250, 0xFFFFFFFF)
                 wait(10000)
        end
      if isKeyJustPressed(VK_M) then
        sampSendChat("/mask")
      end
  end
 end

P.s на кол-во end не смотрите, я просто обрезал скрипт, чтобы было видно проблемное место
 
Последнее редактирование:

Manuel Leon

Известный
266
166
Lua:
local time

function main()
  if not isSampLoaded() or not isSampfuncsLoaded() then return end
  while not isSampAvailable do wait(100) end
  while true do
        wait(0)
        if not sampIsChatInputActive() then
            if isKeyJustPressed(VK_X) then
                sampSendChat("/heal")
                time = os.time() + 5
            end
        end
        if os.time() > time then
            renderFontDrawText(my_font, 'МОЖНО ИСПОЛЬЗОВАТЬ', 1550, 250, 0xFFFFFFFF)
        end
     end
end
 
  • Нравится
Реакции: mills.

mills.

Известный
Автор темы
26
0
Lua:
local time

function main()
  if not isSampLoaded() or not isSampfuncsLoaded() then return end
  while not isSampAvailable do wait(100) end
  while true do
        wait(0)
        if not sampIsChatInputActive() then
            if isKeyJustPressed(VK_X) then
                sampSendChat("/heal")
                time = os.time() + 5
            end
        end
        if os.time() > time then
            renderFontDrawText(my_font, 'МОЖНО ИСПОЛЬЗОВАТЬ', 1550, 250, 0xFFFFFFFF)
        end
     end
end
мне кажется ты переменную вначале забыл ввести полностью