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

my script repeat script doesn't work?

Asked by
Prioxis 673 Moderation Voter
10 years ago

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

Log in to vote
1
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

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

Ad
Log in to vote
0
Answered by
c0des 207 Moderation Voter
10 years ago
repeat
game.Lighting.FogEnd = game.Lighting.FogEnd.Value + 10
until
game.Lighting.FogEnd == 100

Answer this question