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)
The property of a PointLight's color is "Color". It is a Color3 value. Also, make sure the path capitalization is correct. You put "Pointlight", but the default name is "PointLight". You may have changed it, but I just wanted to point it out.
local touching = false script.Parent.Touched:connect(function(touch) if touch.Parent:findFirstChild("Humanoid") then touching = true script.Parent.Parent.Brick.Pointlight.Color = 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.Color = Color3.new(255, 0, 0) script.Parent.Parent.Brick.BrickColor = BrickColor.new("Bright red") end end)