Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

help with making loop active while the rest of the script is still going?

so, its like this

while true do -- this loop is still active when ("ThisIsATest is still active")  is printed
    wait()
    print("ThisIsATest")
end

print("ThisIsATest is still active")

1 answer

✓ Accepted answer

try doing spawn(function() or coroutine.wrap(function(), then put the loop inside. Do it like this:

spawn(function()
	while true do
		wait(1)
		print("ThisIsATest")
	end
end)

print("ThisIsATest is still active")

I added 1 to wait() so it will prevent too much stuff that you can't see the other print. You can also do the coroutine method:

coroutine.wrap(function()
	while true do
		wait(1)
		print("ThisIsATest")
	end
end)

print("ThisIsATest is still active")

Hope this helps!

1 comment

0

tysm

This discussion is preserved as it was. New answers, comments, and votes are closed.