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

['For' loop issue] Can someone just explain to me why this is giving an error?

I am at a loss here. It looks fine to me.

I should know how to fix simple issues like this, but I am lost.

I am getting an error for something that should be somewhat simple. Can someone please point out the possible issue. I have fooled around with this for a bit now and cannot figure out the problem.

for x = 100, x > 85, -5 do
		game.StarterGui.Rain.Dark.BackgroundTransparency = x / 100
end

The error:

22:22:31.718 - ServerScriptService.Rain:6: attempt to compare number with nil

Thanks

3 comments

0

Could you post the full script? Also maybe put a wait in the for loop.

0

The rest of the script doesn't matter (I isolated the incident and got the same result). Also, a wait() will not make a difference.

0

Showing the rest of this script will help us to further understand the problem. Also, are you sure that you can do 'x > 85'? Because, I've never seen a 'for' loop do that before. :P

1 answer

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