Помогите с lua

SLIVERSAYZ MODS

Новичок
Автор темы
9
1
Неинформативное название темы
Версия MoonLoader
Другое
Код:
local status = false
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand('status', function()
        status = not status -- переключаем статус скрипта, если была false станет true и наоборот
        sampAddChatMessage(status and "Включен" or "Выключен", -1) -- в чат напишет значение переменной "status"
    end)
    while true do wait(0)
        if status then
        if sampTextdrawIsExists(2100) then
        setVirtualKeyDown(18, true) -- зажатие 87 клавиши (W)
        wait(500) -- задержка на секунду
        setVirtualKeyDown(18, false) -- отпускание 87 клавиши (W)
        end
    end
end
Код ошибки - 17: 'end' expected (to close 'function' at line 2) near '<eof>'
 
  • Эм
  • Ха-ха
Реакции: MLycoris и Ibraheem

dmitry.karle

Известный
410
108
Lua:
local status = false
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand('status', function()
        status = not status -- переключаем статус скрипта, если была false станет true и наоборот
        sampAddChatMessage(status and "Включен" or "Выключен", -1) -- в чат напишет значение переменной "status"
    end)
    while true do wait(0)
        if status then
            if sampTextdrawIsExists(2100) then
                setVirtualKeyDown(18, true) -- зажатие 87 клавиши (W)
                wait(500) -- задержка на секунду
                setVirtualKeyDown(18, false) -- отпускание 87 клавиши (W)
            end
        end
    end
end
 
  • Нравится
Реакции: SLIVERSAYZ MODS

SLIVERSAYZ MODS

Новичок
Автор темы
9
1
Lua:
local status = false
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand('status', function()
        status = not status -- переключаем статус скрипта, если была false станет true и наоборот
        sampAddChatMessage(status and "Включен" or "Выключен", -1) -- в чат напишет значение переменной "status"
    end)
    while true do wait(0)
        if status then
            if sampTextdrawIsExists(2100) then
                setVirtualKeyDown(18, true) -- зажатие 87 клавиши (W)
                wait(500) -- задержка на секунду
                setVirtualKeyDown(18, false) -- отпускание 87 клавиши (W)
            end
        end
    end
end
Благодарю!
 

selzorinho

Новичок
9
0
Lua:
local status = false

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end

    sampRegisterChatCommand('status', function()
        status = not status
        sampAddChatMessage(status and "Включен" or "Выключен", -1)
    end)

    while true do
        wait(0)
        if status then
            if sampTextdrawIsExists(2100) then
                setVirtualKeyDown(87, true)
                wait(500)
                setVirtualKeyDown(87, false)
            end
        end
    end
end