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

my script repeat script doesn't work?

heres the code

repeat
game.Lighting.FogEnd = game.Lighting.FogEnd.Value +10
until
game.Lighting.FogEnd = 100

but it has a error on line 4/3 i'm not sure what i did wrong can anyone help me?

2 answers

= is assignment. You cannot use it to compare two values. You need to use == to compare two values.

While it will probably work in this case, you should probably make the condition >= anyway, so that if the start length was not a multiple of ten less than one hundred, it will still stop it.

Finally, you don't have any pauses between iterations of the loop, so this would be indistinguishable from just setting the FogEnd to 100. You will probably want to add a wait of some amount to the loop.

Also, this might not be the best place for a repeat loop, but it's more than sufficient.

repeat
game.Lighting.FogEnd = game.Lighting.FogEnd.Value + 10
until
game.Lighting.FogEnd == 100

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