Well we need to do this in 3 steps, remove accessories, remove hats, and then remove the face.
First we can use the RemoveAccessories() function on the humanoid to remove accessories
local character = workspace.Player
character:WaitForChild("Humanoid"):RemoveAccessories()
Next we will make a for loop to remove all hats
local character = workspace.Player
character:WaitForChild("Humanoid"):RemoveAccessories()
for _,v in pairs(character:GetChildren()) do
if v:IsA("Hat") then
v:Destroy()
end
end
Lastly we remove the face, the face is a decal inside the head
local character = workspace.Player
character:WaitForChild("Humanoid"):RemoveAccessories()
for _,v in pairs(character:GetChildren()) do
if v:IsA("Hat") then
v:Destroy()
end
end
character:WaitForChild("Head").face:Destroy()
If you don't want to use the function for accessories we can add it to the for loop
local character = workspace.Player
for _,v in pairs(character:GetChildren()) do
if v:IsA("Hat") or v:IsA("Accessory") then
v:Destroy()
end
end
character:WaitForChild("Head").face:Destroy()
2 comments
To simplify your life, call :RemoveAccessories on the Character's Humanoid. http://wiki.roblox.com/index.php?title=API:Class/Humanoid/RemoveAccessories. Then, just look for the Character's head, and remove the face manually by checking for any decals.
It is a morph button that will turn me into something <-- that works, then it will remove all the accessories (hair, hat) and face (decal face) <-- which doesn't work. It just stays there.