Just stick with return end. If you need to run two loops at once, use the Spawn() function or some other method.
function loop1()
while true do
wait(1)
print"loop1 is running"
end
end
Spawn(loop1)
while true do
wait(1)
print"loop2 is running"
end
Output:
loop1 is running
loop2 is running
loop1 is running
loop2 is running
loop1 is running
loop2 is running
loop1 is running
loop2 is running
and whatnot.
|