Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to loop this script?

Asked by 9 years ago

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

0
Are there errors? What's not working? BlueTaslem 18071 — 9y
0
Please put ALL your code in a code block. You have a few lines in it, but not all of them. Perci1 4988 — 9y

2 answers

Log in to vote
0
Answered by 9 years ago

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
Ad
Log in to vote
-1
Answered by 9 years ago

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"

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. Redbullusa 1580 — 9y

Answer this question