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

How to loop this script?

I'm trying to make a fun game that makes the certain objects teleport to each place, but I want to loop it.. Any ideas of how to make this loop? I want to make it loop infinite.

I've tried this:

while true do wait(132) end for i="Ib", math.huge do end repeat until false

Am I doing something wrong? I put another script into my original one to place that. Here's my complete script to the object.

while true do workspace.Ib:remove() game.Lighting.Ib1:Clone().Parent = game.Workspace wait(15) workspace.Ib1:remove() -- game.Lighting.Ib2:Clone().Parent = game.Workspace

wait(13)
workspace.Ib2:remove()
game.Lighting.Ib3:Clone().Parent = game.Workspace
wait(10)
workspace.Ib3:remove()
game.Lighting.Ib4:Clone().Parent = game.Workspace
wait(19)
workspace.Ib4:remove()
game.Lighting.Ib5:Clone().Parent = game.Workspace
wait(25)

workspace.Ib5:remove()
game.Lighting.Ib6:Clone().Parent = game.Workspace
wait(25)
workspace.Ib6:remove()
game.Lighting.Ib7:Clone().Parent = game.Workspace
wait(25)

end

2 comments

0

Are there errors? What's not working?

0

Please put ALL your code in a code block. You have a few lines in it, but not all of them.

2 answers

✓ Accepted answer

Im not sure what it does but this will loop it ^.^

while true do
wait(13)
workspace.Ib2:remove()
game.Lighting.Ib3:Clone().Parent = game.Workspace
wait(10)
workspace.Ib3:remove()
game.Lighting.Ib4:Clone().Parent = game.Workspace
wait(19)
workspace.Ib4:remove()
game.Lighting.Ib5:Clone().Parent = game.Workspace
wait(25)
workspace.Ib5:remove()
game.Lighting.Ib6:Clone().Parent = game.Workspace
wait(25)
workspace.Ib6:remove()
game.Lighting.Ib7:Clone().Parent = game.Workspace
wait(25)
end

Well, Let me explain.

while true do

Only loops if there are waits.

Here is wrong way.

While true do
script.Part.Transparency = 1
wait(0.3)
script.Part.Transparency = 0

Correct way.

While true do
wait(0.1)
script.Part.Transparency = 1
wait(0.3)
script.Part.Transparency = 0

Make sure you put a wait as soon as you finish "While true do"

1 comment

0

The correct way is still the wrong way. Just un-capitalize "While". Also, it doesn't really matter where the wait() function is located, so long as there is one.

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