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

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

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.

1 comment

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?

1 answer

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."

3 comments

0

If that answers your question make sure to accept the answer, thanks :)

0

I disagree.

0

Explain, I'm fairly new to scripting, but I think it should work

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