✓ Accepted answer
Ya, I had this same kind of problem, try using Coroutine's, this type of Coroutine I'm about to show you, it can do multiple codes at once;
coroutine.resume(coroutine.create(function()
while true do
wait(5)
print("I'm in a coroutine!")
end
end))
coroutine.resume(coroutine.create(function()
while true do
wait(5)
print("I'm in a coroutine too!")
end
end))
while true do
wait(5)
print("I'm not!")
end
As you'll see, every 5 seconds, the three loops will print I'm in a coroutine!, I'm in a coroutine too!, I'm not! in the Output.
The coroutine.resume(coroutine.create(function() end)) allows you to do multiple loops/codes at once.
Head to this link for more information about Coroutine's, http://wiki.roblox.com/index.php?title=Coroutines.
Hope this helped!
2 comments
coroutine.wrap(function)()is much shorter thancoroutine.resume(coroutine.create(function)); even shorter isdelay(function,0)Makes sense