Hello I've been trying to get some of my script to change the color of a part when touched to the player's head color but with no luck, if I can please get some help with this it would be very much appreciated.
I don't really have a lot of the code except the touch part but I can't make it to change the color to the player's head color.
Well, speaking generally, there's nothing too difficult, you can utilize a BasePart's "Touched" event in order to detect when it is touched, then, simply check for and grab the head's (if it is there) color, then apply it to the part.
A very simple example would be this:
local part = Instance.new("Part", workspace); part.Touched:Connect(function(object) if object.Parent:FindFirstChild("Head") then part.Color = object.Parent.Head.Color; end end)
local part = Instance.new(“workspace”, Part) part.Touched:Connect(function(object) local object = object.Parent local findHead = object:findFirstChild(“Head”) findHead.Color = Color3.new(your color code here)