Problem with Lighting script

Im trying to make a block that, when touched, will change the colorshift. But when I test it out in game, instead of setting the colorshift to 255,0,0 it sets the colorshift to 65025, 0, 0. Here’s the script.

function onTouch(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
	if (humanoid ~= nil) then 
		game.Lighting.Ambient = Color3.new(0,0,0)
		game.Lighting.ColorShift_Bottom = Color3.new(255, 0, 0)
		game.Lighting.ColorShift_Top = Color3.new(255, 0, 0)
end
end
script.Parent.Touched:connect(onTouch)

is there any solution to this? What did I do wrong? Any help is appreciated.

make sure to yield the touch event!

1 Like

Use the Color3.fromRGB() constructor if you are using values from 0-255.

4 Likes