Cannot resume dead coroutine? I tried using coroutine.yield() to stop the coroutine, but I think I used it wrong. I need it to resume the coroutine after it stops it. What the script does is it resumes the coroutine, then stops it, and then breaks the while true do, but I need it to resume, not break the while true do script. In output is said "cannot resume dead coroutine." How to fix this?

local leaderstats = coroutine.wrap(function()
	while wait(0.03125) do
		--Does stuff
	end
	coroutine.yield()
end)

while true do
	leaderstats() -- Resumes coroutine
	for i = 1, 32 do
		--Does stuff
	end
	leaderstats() -- Stops coroutine
	--Does stuff
	wait(4)
	--Does stuff
end

Thanks!