I am trying to make a part change color if player touches it, but it won't work. I am new scripter so can someone describe me about how will this script work?
part.Tocuehd:connect(function(hit) humanoid=hit.Parent:FindFirstChild("Humanoid") if humanoid ~=nil then game.Workspace.carpet.BrickColor=BrickColor.Color3.new(117,0,0) end end)
For first use "Connect" cuz "connect" is deprecated. You have many errors in your script.
part.Touched:Connect(function(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") if humanoid then game.Workspace.carpet.BrickColor = BrickColor.new("Really red") --changing color to red end end)
Here is colors that you can use for brickcolor.
one more bouns thing. If you want to convert some brickcolor to Color3(RGB) just type this code:
BrickColor = BrickColor.new("Really red").Color
You can use that like this:
local BrickToColor = BrickColor.new("Really red").Color script.Parent.Color = Color3.new(BrickToColor)