Player:LoadCharacter yields forever

coroutine.wrap(function()
	print'A1'
	game.Players.Sharksie:LoadCharacter()
	print'A2'
end)()

print'B1'
game.Players.Sharksie:LoadCharacter()
print'B2'

Output reads: A1 B1 A2

B2 never prints

When multiple LoadCharacter requests are queued, only the first one ever resumes. This makes it very difficult to design something like a spawning system without leaking threads.

14 Likes

Umm Iā€™m still getting this. I updated my game to R15 without hearing about the LoadCharacter yielding, and now the game will pause when the round ends cuz I used to end it with LoadCharacter.

2 Likes