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

Is this script going to work? [I have to go soon, I'm asking because I don't have time to test it.]

Asked by 7 years ago

I am working on a FNAF game as a commission from somebody, and I am trying to test this script. I am asking if the (for i=1, 10 do) part is going to work, and as I try to put it, make the script play itself ten times. I know everything else is correct, because I had time to test it. But I am just wondering, is there a mistake in it, or will it work when I have time to come back and test it?

Lighting = game.ServerStorage

Seconde = wait()

World = game.Workspace

for i=1, 10 do
while true do
wait(20)
World.TFred:Destroy()
Lighting.TFred1:Clone().Parent = game.Workspace
wait(20)
World.TFred1:Destroy()
Lighting.TFred2:Clone().Parent = game.Workspace
wait(20)
World.TFred2:Destroy()
Lighting.TFred3:Clone().Parent = game.Workspace
wait(20)
World.TFred3:Destroy()
Lighting.TFred4:Clone().Parent = game.Workspace
wait(20)
World.TFred4:Destroy()
Lighting.TFred:Clone().Parent = game.Workspace
end

And for the sarcastic people saying, "you could've tested it instead of using your time to ask this", I can't because ROBLOX STUDIO isn't working at the moment for me.

0
How about instead of taking commissions as a rush job when ROBLOX studio isn't working for you, you take the time to properly test and troubleshoot yourself instead of outsourcing it here? P100D 590 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

Put this instead:

Lighting = game.ServerStorage

Seconde = wait()

World = game.Workspace

for i=1, 10 do
wait(20)
World.TFred:Destroy()
Lighting.TFred1:Clone().Parent = game.Workspace
wait(20)
World.TFred1:Destroy()
Lighting.TFred2:Clone().Parent = game.Workspace
wait(20)
World.TFred2:Destroy()
Lighting.TFred3:Clone().Parent = game.Workspace
wait(20)
World.TFred3:Destroy()
Lighting.TFred4:Clone().Parent = game.Workspace
wait(20)
World.TFred4:Destroy()
Lighting.TFred:Clone().Parent = game.Workspace
end

the for loop alone will repeat the script ten times, adding a while loop would require you add another "end."

0
If that answers your question make sure to accept the answer, thanks :) UsernameEqualsTaken 30 — 7y
0
I disagree. OldPalHappy 1477 — 7y
0
Explain, I'm fairly new to scripting, but I think it should work UsernameEqualsTaken 30 — 7y
Ad

Answer this question