Вопрос по Lua скрипту

Zeusss

Активный
Автор темы
170
33
Решил я попробовать что-то написать на Луа по руководствам в интернете, вылазит такая ошибка
[18:41:20.477963] (error) script.lua: ...xxxxx\xxxxxxxxxxx\moonloader\script.lua:10: 'then' expected near 'SampFuncsLoaded' [18:41:20.477963] (error) script.lua: Script died due to an error. (2BEA84CC)
Для меня это что-то вроде этого 户畫畵画 . Кто разбираеться, можете, пожайлуста, объянить в чём проблема?
 
Решение
script_name("Script") script_author("DE1462") script_description("command") require "lib.moonloader" local tag = "[first script]" function main() if not isSampLoaded() or not SampfuncsLoaded() then return end while not isSampAvaible() do wait(100) end sampAddChatMessage("text to test", #0xFFFF00) while true do wait(0) end end

уже стоит
Lua:
script_name("Script")
script_author("DE1462")
script_description("command")

require "lib.moonloader"

local tag = "[first script]"

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

    sampAddChatMessage("text to test", 0xFFFF00)

    while true do
        wait(0)

    end
end
Ошибка была в...

Zeusss

Активный
Автор темы
170
33
Вместо SampFuncsLoaded должно быть SampfuncsLoaded
Теперь это вылазит :(
11:16:49.480092] (error) Script: ...xxxxxxx\xxxxxxxxx\xxxxxxxxxxx\script.lua:10: attempt to call global 'SampfuncsLoaded' (a nil value) stack traceback: ...test scripts\summer gta by Harnelo\moonloader\script.lua: in function <...test scripts\summer gta by Harnelo\moonloader\script.lua:9> [11:16:49.480092] (error) Script: Script died due to an error. (12EFD07C)
 

Zeusss

Активный
Автор темы
170
33
Код скрипта скинь
script_name("Script") script_author("DE1462") script_description("command") require "lib.moonloader" local tag = "[first script]" function main() if not isSampLoaded() or not SampfuncsLoaded() then return end while not isSampAvaible() do wait(100) end sampAddChatMessage("text to test", #0xFFFF00) while true do wait(0) end end
из SamfuncsLoaded сделай isSamfuncsLoaded()
уже стоит
 
Последнее редактирование:

reversed

Участник
69
17
script_name("Script") script_author("DE1462") script_description("command") require "lib.moonloader" local tag = "[first script]" function main() if not isSampLoaded() or not SampfuncsLoaded() then return end while not isSampAvaible() do wait(100) end sampAddChatMessage("text to test", #0xFFFF00) while true do wait(0) end end

уже стоит
Lua:
script_name("Script")
script_author("DE1462")
script_description("command")

require "lib.moonloader"

local tag = "[first script]"

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

    sampAddChatMessage("text to test", 0xFFFF00)

    while true do
        wait(0)

    end
end
Ошибка была в:
1. SampfuncsLoaded() - isSampfuncsLoaded()
2. isSampAvaible() - isSampAvailable()
3. Цвет был указан с # в начале: #0xFFFF00 - 0xFFFF00
 
  • Нравится
Реакции: Zeusss

Zeusss

Активный
Автор темы
170
33
Lua:
script_name("Script")
script_author("DE1462")
script_description("command")

require "lib.moonloader"

local tag = "[first script]"

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

    sampAddChatMessage("text to test", 0xFFFF00)

    while true do
        wait(0)

    end
end
Ошибка была в:
1. SampfuncsLoaded() - isSampfuncsLoaded()
2. isSampAvaible() - isSampAvailable()
3. Цвет был указан с # в начале: #0xFFFF00 - 0xFFFF00
Спасибо