Что за ошибка? Как исправить?

skief

Участник
Автор темы
40
14
[ML] (error) shipilya.lua: ... GAMES\bin\GTA 140K BY DAPO SHOW\moonloader\shipilya.lua:9: ')' expected near 'then'
[ML] (error) shipilya.lua: Script died due to an error. (0FB06B84)
Код:
[ML] (error) shipilya.lua: ... GAMES\bin\GTA 140K BY DAPO SHOW\moonloader\shipilya.lua:9: ')' expected near 'then'
[ML] (error) shipilya.lua: Script died due to an error. (0FB06B84)

script_name("FightHelper")
script_author("shipilya")
script_version("25.11.2020")
    
function main()
local keys = require "vkeys"
    repeat wait() until isSampAvailable()
    wait(0)
    if isKeyDown(VK_MENU and isKeyJustPressed(VK_31) then
        sampAddChatMessage("/usedrugs 3")
    end
 

skief

Участник
Автор темы
40
14
попробуй перевести в след раз ошибку. на 12 строке пропущена скобка, где VK_MENU, нужно закрыть
ML] (error) shipilya.lua: ... GAMES\bin\GTA 140K BY DAPO SHOW\moonloader\shipilya.lua:12: 'end' expected (to close 'function' at line 5) near '<eof>'
[ML] (error) shipilya.lua: Script died due to an error. (1074031C)
попробуй перевести в след раз ошибку. на 12 строке пропущена скобка, где VK_MENU, нужно закрыт
Я переписал чутка код. Щас проверю на работу. Можешь сказать что тут не так?
Код:
script_name("FightHelper")
script_author("shipilya")
script_version("25.11.2020")

function main()
local keys = require "vkeys"
    repeat wait() until isSampAvailable()
    wait(0)
        end
    if isKeyDown(VK_MENU) and isKeyJustPressed(VK_31) then
        sampAddChatMessage("/usedrugs 3")
    end
[ML] (system) FightHelper: Loaded successfully.
FightHelper: Script terminated. (104F1BCC)
 

wulfandr

Известный
637
260
ML] (error) shipilya.lua: ... GAMES\bin\GTA 140K BY DAPO SHOW\moonloader\shipilya.lua:12: 'end' expected (to close 'function' at line 5) near '<eof>'
[ML] (error) shipilya.lua: Script died due to an error. (1074031C)

Код:
script_name("FightHelper")
script_author("shipilya")
script_version("25.11.2020")

function main()
local keys = require "vkeys"
    repeat wait() until isSampAvailable()
    wait(0)
        end
    if isKeyDown(VK_MENU) and isKeyJustPressed(VK_31) then
        sampAddChatMessage("/usedrugs 3")
    end
[ML] (system) FightHelper: Loaded successfully.
FightHelper: Script terminated. (104F1BCC)
еще раз повторю, переведи ошибку

Lua:
script_name("FightHelper")
script_author("shipilya")
script_version("25.11.2020")

local keys = require "vkeys"

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    while true do wait(0)
        if isKeyDown(VK_MENU) and isKeyJustPressed(VK_3) then -- if pressed ALT and button 3 then
            sampAddChatMessage("/usedrugs 3", -1) -- -1 white color
            sampSendChat('/usedrugs 3')
        end
    end
end
 

skief

Участник
Автор темы
40
14
еще раз повторю, переведи ошибку

Lua:
script_name("FightHelper")
script_author("shipilya")
script_version("25.11.2020")

local keys = require "vkeys"

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    while true do wait(0)
        if isKeyDown(VK_MENU) and isKeyJustPressed(VK_3) then -- if pressed ALT and button 3 then
            sampAddChatMessage("/usedrugs 3", -1) -- -1 white color
            sampSendChat('/usedrugs 3')
        end
    end
end
перевести, то я перевел, надо закрыть функцию на линии 5, но все равно через 2 секунды крашится скрипт
перевести, то я перевел, надо закрыть функцию на линии 5, но все равно через 2 секунды крашится скрипт
вопрос решился, убрал задержку 2000 на -1