I just makes me yellow...
script.Parent.Touched:connect(function(part) player = part.Parent if player.Head.BrickColor ~= ("Bright yellow") then print("changed to crusty") player = part.Parent player.Head.BrickColor = BrickColor.new("Bright yellow") player.Torso.BrickColor = BrickColor.new("Bright yellow") player["Left Arm"].BrickColor = BrickColor.new("Bright yellow") player["Left Leg"].BrickColor = BrickColor.new("Bright yellow") player["Right Leg"].BrickColor = BrickColor.new("Bright yellow") player["Right Arm"].BrickColor = BrickColor.new("Bright yellow") elseif player.Head.BrickColor == ("Bright yellow") then player.Head.BrickColor = BrickColor.new("Bright green") player.Torso.BrickColor = BrickColor.new("Bright green") player["Left Arm"].BrickColor = BrickColor.new("Bright green") player["Left Leg"].BrickColor = BrickColor.new("Bright green") player["Right Leg"].BrickColor = BrickColor.new("Bright green") player["Right Arm"].BrickColor = BrickColor.new("Bright green") end end)
EDIT: Updated.
Hello!
The issue is that roblox has a system for coloring characters, wich is held in an instance called Body Colors
.
To fix this, right on the beggining of your script, you must remove them. For this do
player:WaitForChild('Body Colors'):Destroy()
You are also doing a common mistake.
BrickColors
aren't strings
!!!
Therefore, you must do BrickColor.new(Colour)
instead.
This would be your script:
script.Parent.Touched:connect(function(part) player = part.Parent if player.Head.BrickColor ~= BrickColor.new("Bright yellow") then print("changed to crusty") player = part.Parent player:WaitForChild('Body Colors'):Destroy() player.Head.BrickColor = BrickColor.new("Bright yellow") player.Torso.BrickColor = BrickColor.new("Bright yellow") player["Left Arm"].BrickColor = BrickColor.new("Bright yellow") player["Left Leg"].BrickColor = BrickColor.new("Bright yellow") player["Right Leg"].BrickColor = BrickColor.new("Bright yellow") player["Right Arm"].BrickColor = BrickColor.new("Bright yellow") elseif player.Head.BrickColor == BrickColor.new("Bright yellow") then player.Head.BrickColor = BrickColor.new("Bright green") player.Torso.BrickColor = BrickColor.new("Bright green") player["Left Arm"].BrickColor = BrickColor.new("Bright green") player["Left Leg"].BrickColor = BrickColor.new("Bright green") player["Right Leg"].BrickColor = BrickColor.new("Bright green") player["Right Arm"].BrickColor = BrickColor.new("Bright green") end end)