Hi! I am stuck on this. So the scenario is tht a "Brick" and "Pad" are both in a model. Then I used this code so when you touch the pad, the pointlight and brick will change to another color and when you stop touching it, it goes back to red. Can someone please help tell what is wrong?
local touching = false
script.Parent.Touched:connect(function(touch)
if touch.Parent:findFirstChild("Humanoid") then
touching = true
script.Parent.Parent.Brick.Pointlight.color3.new(85, 255, 0)
script.Parent.Parent.Brick.BrickColor = BrickColor.new("Bright green")
end
end)
script.Parent.TouchEnded:connect(function(untouch)
if untouch.Parent:findFirstChild("Humanoid") then
touching = false
script.Parent.Parent.Brick.Pointlight.color3.new(255, 0, 0)
script.Parent.Parent.Brick.BrickColor = BrickColor.new("Bright red")
end
end)

1 comment
Color3 values range from 0 to 1, not 0 to 255 (which it appears as [incorrectly] in the Properties tab). Divide by 255 to get the proper values, e.g., 85 -> 0.333 or 85/255