I’d really recommend looking at the API reference in the future.
@waterrunner To add on to this, setting a PointLight’s Color value to a BrickColor will lead to an error as it’s expecting a Color3 value. Luckily, BrickColors have a .Color property so you can just use that to get the Color3 value.
local clickdetector = script.Parent:WaitForChild(“ClickDetector”)
clickdetector.MouseClick:Connect(function(player)
game.Workspace.LightA.Pointlight.Color = BrickColor.new("CGA brown").Color
end)
@UsernameMissingOrNil
Thanks for picking me up on this. I have deleted my previous reply to avoid spreading misconceptions and broken code.
The reason why your script ins’t working is because you are attempting to pass a string into color3.new() when it only accepts numbers. A simple fix would be to do Color3.fromRGB() and pass the R, G, B value of the color you want.
Here is your code fixed:
local clickdetector = script.Parent:WaitForChild("ClickDetector")
clickdetector.MouseClick:Connect(function(player)
game.Workspace.LightA.Pointlight.Color = Color3.fromRGB(0,0,0) -- Change this to the color you want
end)