Spawn(function()
while wait(3) do
print("3seconds") --Prints "3seconds" every 3 seconds and "0.1second" every 0.1 second
end end)
while wait(0.1) do
print("0.1second")
end
Help?
Spawn(function()
while wait(3) do
print("3seconds") --Prints "3seconds" every 3 seconds and "0.1second" every 0.1 second
end end)
while wait(0.1) do
print("0.1second")
end
Help?
As I said earlier, adding another spawn should fix this. I did forget to mention that you had to use the spawn before your final while loop.
Spawn(function()
while wait(5) do
print("5seconds") --Prints "5seconds" every 5 seconds and "0.1second" every 0.1 second
end
end)
Spawn(function()
while wait(3) do
print("3seconds") --Prints "3seconds" every 3 seconds and "0.1second" every 0.1 second
end
end)
Spawn(function() -- keep the program looking consistent, and in case you need/want to do something AFTER this part of the script
while wait(1) do -- I changed this to 1 btw.
print("1second")
end
end)
coroutine.resume(coroutine.create(function()
while wait() do
--first loop
end
end))
coroutine.resume(coroutine.create(function()
while wait() do
--second loop
end
end))
coroutine.resume(coroutine.create(function()
while wait() do
--third loop
end
end))
Spawning a function is better practice for this type of thing because it's more efficient (because it's merely designed to do just that.)
http://wiki.roblox.com/index.php?title=Function_dump/Coroutine_manipulation
<- someone pointed to me for this if anyone else had the same question
BUT STILL ANSWER IF THERE IS ANOTHER WAY
You didn't simplify it for him..
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
..Just add another Spawn?
i tried that..hmm
thx for the effort though