how do I make this script so that instead of touching a part when the player clicks on the gui button he gets his head colored to the color of the button
function onTouched(part)
player = game.Players:GetPlayerFromCharacter(script.Parent)
if player ~= nil then
part.Parent.Head.BrickColor = script.Parent.BrickColor
end
end
script.Parent.Touched:connect(onTouched)

1 comment
If you want to get the player i updated the code for you.