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

I am having trouble changing the ambient, can someone please help?

local Lighting = a

a.ambient = 0, 255, 255

wait (1)

a.ambient = 0, 255, 0

wait (1)

a.ambient = 255, 0, 0

wait (1)

a.ambient = 255, 255, 0

wait (1)

a.ambient = 255, 85, 0

wait (1)

a.ambient = 170, 0, 255

wait (1)

I just don't know what's wrong, what I want it to do is Change ambient after one second and repeat those ambients in a loop so the script continously repeats itslelf. Any help?

1 answer

✓ Accepted answer

Declare your variable before calling what you want your variable to be. Also, Ambient takes in Color3 values, so it would be something like this, as well as a loop required.

local a = game.Lighting
while true do
a.Ambient = Color3.new(0, 255, 255)
wait(1)

a.Ambient = Color3.new(0, 255, 0)
wait(1)

a.Ambient = Color3.new(255, 0, 0)
wait(1)

a.Ambient = Color3.new(255, 255, 0)
wait(1)

a.Ambient = Color3.new(255, 85, 0)
wait(1)

a.Ambient = Color3.new(170, 0, 255)
wait(1)
end

1 comment

0

Thank you so much, xD I am very new with scripting

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