Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why does this anonymous coroutine do nothing?

Why does this anonymous coroutine does nothing? How do you start this coroutine?

while true do
	coroutine.wrap(function()
		for i = 1, player.leaderstats.Score.Value do
			--Does something
			wait(0.03125)
		end
		coroutine.yield()
	end)
end

1 answer

✓ Accepted answer
while true do
   local s = coroutine.wrap(function()
        for i = 1, player.leaderstats.Score.Value do
            --Does something
            wait(0.03125)
        end
        coroutine.yield()
    end)
	s()
end

This discussion is preserved as it was. New answers, comments, and votes are closed.