Неактуально help me | Crash script lua

cenor_yt

Новичок
Автор темы
13
0
Версия MoonLoader
.026-beta
ERROR:
attempt to yield across C-call boundary
stack traceback:
    [C]: in function 'wait'


CODE:
sampRegisterChatCommand("prov", function(arg)
    if arg:find('(.+)') then
        arg1 = arg:match('(.+)')
        sampSendChat("/a /write "..arg1.." 2 AFK & OFF = ban")
        wait(1500)
        sampSendChat("/spoff")
        wait(1500)
        sampSendChat("/tp 52")
        wait(3000)
        sampSendChat("/gethere "..arg1)   
    else
        sampAddChatMessage('Напиши /prov [ID]', -1)
    end
end)
 
Решение
Lua:
sampRegisterChatCommand("prov", function(arg)
    if arg:find('(.+)') then
        lua_thread.create(function()
            arg1 = arg:match('(.+)')
            sampSendChat("/a /write "..arg1.." 2 AFK & OFF = ban")
            wait(1500)
            sampSendChat("/spoff")
            wait(1500)
            sampSendChat("/tp 52")
            wait(3000)
            sampSendChat("/gethere "..arg1)
        end)
    else
        sampAddChatMessage('Напиши /prov [ID]', -1)
    end
end)

MLycoris

Режим чтения
Проверенный
1,821
1,860
Lua:
sampRegisterChatCommand("prov", function(arg)
    if arg:find('(.+)') then
        lua_thread.create(function()
            arg1 = arg:match('(.+)')
            sampSendChat("/a /write "..arg1.." 2 AFK & OFF = ban")
            wait(1500)
            sampSendChat("/spoff")
            wait(1500)
            sampSendChat("/tp 52")
            wait(3000)
            sampSendChat("/gethere "..arg1)
        end)
    else
        sampAddChatMessage('Напиши /prov [ID]', -1)
    end
end)
 

cenor_yt

Новичок
Автор темы
13
0
Lua:
sampRegisterChatCommand("prov", function(arg)
    if arg:find('(.+)') then
        lua_thread.create(function()
            arg1 = arg:match('(.+)')
            sampSendChat("/a /write "..arg1.." 2 AFK & OFF = ban")
            wait(1500)
            sampSendChat("/spoff")
            wait(1500)
            sampSendChat("/tp 52")
            wait(3000)
            sampSendChat("/gethere "..arg1)
        end)
    else
        sampAddChatMessage('Напиши /prov [ID]', -1)
    end
end)
Благодарю.