Cannot resume non-suspended coroutine

.EOS

Участник
Автор темы
60
3
Версия MoonLoader
.026-beta
[01:45:36.756477] (error) surv_zone_helper: cannot resume non-suspended coroutine
stack traceback:
...A San Andreas Clear Test\moonloader\surv_zone_helper.lua: in function <...A San Andreas Clear Test\moonloader\surv_zone_helper.lua:178>
[01:45:36.756477] (error) surv_zone_helper: Script died due to an error. (0194947C)

Когда устанавливаю переменную isMiningMetal = false то вылазит эта ошибка

Lua:
function miningthread()
    while true do wait(0)
        lua_thread.create(function()
            if isMiningMetal == true then
                wait(250)
                setGameKeyState(11, 64)
                wait(150)
                wait(20700)
            end
        end)
    end
end
 

Quasper

Известный
834
354
[01:45:36.756477] (error) surv_zone_helper: cannot resume non-suspended coroutine
stack traceback:
...A San Andreas Clear Test\moonloader\surv_zone_helper.lua: in function <...A San Andreas Clear Test\moonloader\surv_zone_helper.lua:178>
[01:45:36.756477] (error) surv_zone_helper: Script died due to an error. (0194947C)

Когда устанавливаю переменную isMiningMetal = false то вылазит эта ошибка

Lua:
function miningthread()
    while true do wait(0)
        lua_thread.create(function()
            if isMiningMetal == true then
                wait(250)
                setGameKeyState(11, 64)
                wait(150)
                wait(20700)
            end
        end)
    end
end
бесконечный цикл может быть только внутри основного потока скрипта либо же созданного потока, тут же у тебя поток создаётся в бесконечном цикле
Lua:
function miningthread()
    lua_thread.create(function()
        while true do wait(0)
            if isMiningMetal == true then
                wait(250)
                setGameKeyState(11, 64)
                wait(150)
                wait(20700)
            end
        end
    end)
end