Why do multiple loops inside a script (in this case a LocalScript) seem to fail when other loops are running?
✓ ANSWER ACCEPTED
Why do multiple loops inside a script seem to fail when other loops are running?
1 answer
✓ Accepted answer
Probably because you're using endless loops and not putting coroutines
Say you have this in a script;
while wait(1) do
print(math.random(1,5))
end
print('Derp')
'Derp' will never be printed, due to the endless loop above it.
So a way to fix? Coroutines.
coroutine.wrap(function()
while wait(1) do
print(math.random(1,5))
end
end)()
print('Derp')
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
THankyou