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

New color help?

Asked by
NotSoNorm 777 Moderation Voter
10 years ago

Any help? I'm trying to make it so it will change colors on clicked, I only know Color3 not Color. What do I do?

x = script.Parent.Parent.Parent.Parent.Parent.Parent.Lights
script.Parent.MouseButton1Down:connect(function()
    x.Rainbow.SpotLight.Color(255, 0, 0)
    x.Rainbow1.SpotLight.Color(0, 38, 255)
    x.Rainbow2.SpotLight.Color(255, 255, 255)
    x.Rainbow3.PointLight.Color(0, 5, 77)
end)

1 answer

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

Color is a property, not a function... You set it by using = (assignment).

It takes a Color3 value, whose constructor is Color3.new and whose arguments are from 0 to 1 instead of 0 to 255. It would look like this:

someLight.Color = Color3.new(0,0.4,0.9);
0
So something like this? NotSoNorm 777 — 10y
0
x.Rainbow2.SpotLight.Color = Color3.new(255/255, 255/255, 255/255); NotSoNorm 777 — 10y
0
Yes, that's what I said BlueTaslem 18071 — 10y
Ad

Answer this question