Ad
Log in to vote
-1

My light color changer isn't working. Please help?

Asked by 7 years ago

This is my script. I don't know why it's not working, but it's frustrating me. I've tried fixing the color script 12 times now and I can't get it. Can someone help me?

NewLight = script.Parent.Pointlight

while true do
NewLight.Color = NewLight.Light.Color(0,255,255)
wait(0.3)
NewLight.Color = NewLight.Light.Color(255,255,255)
wait(0.3)
end

1 answer

Log in to vote
0
Answered by
Mystdar 352 Moderation Voter
7 years ago

Color may need to be Color.new(r, g, b) and it needs to be out of 1 not 255 so try:

NewLight = script.Parent.Pointlight

while true do
     NewLight.Light.Color = NewLight.Light.Color.new(0, 1, 1)
    wait(0.3)
     NewLight.Light.Color = NewLight.Light.Color.new(1, 1, 1)
    wait(0.3)
end

Remember to tab your code

Alternatively you could have

 NewLight.Light.Color = NewLight.Light.Color.new(0/255, 255/255, 255/255)
Ad

Answer this question