Не работает Lua

Unis

Новичок
Автор темы
6
0
Написал крч свой первый Lua, но он не работает. Подскажите пожалуйста что не так, я уже просто хз чё делать.
 

Вложения

  • CarHelper.lua
    469 байт · Просмотры: 11
Решение
Что-то не помогло, а сам луа перестал работать
Lua:
function main()
    while not isSampAvailable() do wait(0) end
    sampAddChatMessage('CarHelper активен', 0x800080)
    while true do
        wait(0)
        if wasKeyPressed(76) and not sampIsChatInputActive() then
            sampSendChat('/lock')
        elseif wasKeyPressed(75) and not sampIsChatInputActive() then
            sampSendChat('/key')
        end
    end
end

Unis

Новичок
Автор темы
6
0
текст файла скинь
Уже всё работает, но подскажите как зделать что бы при открытом чате не работал он



require "lib.moonloader"

local keys = require "vkeys"

function main()

if not isSampLoaded() or not isSampfuncsLoaded()
then return
end

while not isSampAvailable()
do
wait(100)
end

sampAddChatMessage('CarHelper активен', 0x800080)

while true do
wait(0)

if isKeyJustPressed(VK_L)
then
sampSendChat('/lock')
elseif isKeyJustPressed(VK_K)
then
sampSendChat('/key')
end

end

end
 

chapo

🫡 В армии с 17.10.2023. В ЛС НЕ ОТВЕЧАЮ
Друг
8,778
11,223
Уже всё работает, но подскажите как зделать что бы при открытом чате не работал он



require "lib.moonloader"

local keys = require "vkeys"

function main()

if not isSampLoaded() or not isSampfuncsLoaded()
then return
end

while not isSampAvailable()
do
wait(100)
end

sampAddChatMessage('CarHelper активен', 0x800080)

while true do
wait(0)

if isKeyJustPressed(VK_L)
then
sampSendChat('/lock')
elseif isKeyJustPressed(VK_K)
then
sampSendChat('/key')
end

end

end
Lua:
require "lib.moonloader"


local keys = require "vkeys"


function main()


  if not isSampLoaded() or not isSampfuncsLoaded()

    then return

  end


  while not isSampAvailable()

  do

    wait(100)

  end


  sampAddChatMessage('CarHelper активен', 0x800080)


  while true do

    wait(0)


    if isKeyJustPressed(VK_L) and not sampIsChatInputActive()

    then

      sampSendChat('/lock')

    elseif isKeyJustPressed(VK_K)

    then

      sampSendChat('/key')

    end


  end


end
 
  • Bug
Реакции: tinkoir

Unis

Новичок
Автор темы
6
0
Lua:
require "lib.moonloader"


local keys = require "vkeys"


function main()


  if not isSampLoaded() or not isSampfuncsLoaded()

    then return

  end


  while not isSampAvailable()

  do

    wait(100)

  end


  sampAddChatMessage('CarHelper активен', 0x800080)


  while true do

    wait(0)


    if isKeyJustPressed(VK_L) and not sampIsChatInputActive()

    then

      sampSendChat('/lock')

    elseif isKeyJustPressed(VK_K)

    then

      sampSendChat('/key')

    end


  end


end
Что-то не помогло, а сам луа перестал работать
 

chapo

🫡 В армии с 17.10.2023. В ЛС НЕ ОТВЕЧАЮ
Друг
8,778
11,223
Что-то не помогло, а сам луа перестал работать
Lua:
function main()
    while not isSampAvailable() do wait(0) end
    sampAddChatMessage('CarHelper активен', 0x800080)
    while true do
        wait(0)
        if wasKeyPressed(76) and not sampIsChatInputActive() then
            sampSendChat('/lock')
        elseif wasKeyPressed(75) and not sampIsChatInputActive() then
            sampSendChat('/key')
        end
    end
end
 
Последнее редактирование: