In order to remove the face of a player's character, we'll have check if the part touching the button is a child of a player. We should also check to see if the part has a humanoid (which was good for you to use in the first place, however you likely messed up on the conditional statement).
EDIT: I went ahead and re-coded this script to be more efficient when locating a face, as my last code error'ed after the face was removed from the player's character.
02 | local part = script.Parent |
04 | part.Touched:connect( function (hit) |
05 | if hit.Parent:findFirstChild( "Humanoid" ) ~ = nil and deb then |
09 | local head = hit.Parent:FindFirstChild( "Head" ) |
11 | for i,v in pairs (head:GetChildren()) do |
12 | if v:IsA( "Decal" ) then |
15 | print ( "Not a valid decal instance" ) |
20 | print ( "Part is not a child of a character" ) |
Questions / comments? Feel free to message me and I'll answer them as soon as possible. If you are satisfied with the answer I provided, please upvote me. Thanks!