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

Lighting ambient change script isn't working and glitching, help?

while true do
	wait(5)
	game.ServerStorage.Lightning:Clone().Parent = workspace
	game.Lighting.Ambient = Color3.new(300, 300, 300)
	wait(1)
	game.Lighting.Ambient = Color3.new(100, 100, 100)
	game.Workspace.Lightning:Destroy()
end

I don't need help on anything other than the ambient change. When i go to test it it glitches out and the ambient goes to thousands. I just want it to go to 300,300,300 and then go back to what it was (100,100,100).

1 answer

✓ Accepted answer

You have to divide Color3 Values by 255.

So first of all, the Color3 only goes up to 255. On line 4, you put 300s. This should fix your script,

while true do
    wait(5)
    game.ServerStorage.Lightning:Clone().Parent = workspace
    game.Lighting.Ambient = Color3.new(255/255, 255/255, 255/255)
    wait(1)
    game.Lighting.Ambient = Color3.new(100/255, 100/255, 100/255)
    game.Workspace.Lightning:Destroy()
end
I'm also not sure what line 7 is suppose to do, but whatever.

Good Luck

If I helped, please don't forget to accept my answer.

1 comment

0

Line 4 could also just be Color3.new(1, 1, 1)

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