From somewhere in the code bellow I’m getting the error “cannot resume dead coroutine”
The error message did not say which line and I don’t know what to try.
local function doFight()
local runFight = coroutine.create(function()
zoneEvent:Fire(nil, nil, nil, nil, "None", nil, 32)
doBoundaries(true)
moveBells()
task.wait(1)
zoneEvent:Fire(nil, nil, nil, nil, "PointyReckoning", nil, 32)
syncBells(game.SoundService.PointyReckoning)
while fightActive and not clangorDefeated do
lungeAt()
end
end)
coroutine.resume(runFight)
--Disable fight if player dies
player.Character.Humanoid.Died:Connect(function()
if coroutine.status(runFight) ~= "dead" then
coroutine.close(runFight)
resetFight()
end
end)
return runFight
end
doFight()
edit: yes, the doFight is only called once