What I am trying to achieve is a script that will delete the users face when they join.
This is being ran in a script inside of ServerScriptService, no idea why its not working.
Edit: I forgot to mention, it is giving nothing in the output as well, and I used prints to find out that the CharacterAdded and PlayerAdded functions are working, but the face just wont delete.
Maybe players head isnt loaded when you are trying to destroy the face, try adding a task.wait(0.5) before destroying the face, or change it to char:WaitForChild("Head").face:Destroy()
Instead of looking for the face decal inside of the head, you could find it through it’s class and then destroy it.
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local Face = Character:WaitForChild("Head"):FindFirstChildOfClass("Decal")
if Face then
Face:Destroy()
end
end)
end)
This would interfere with my other scripts (which places two decals, one for a mouth, one for eyes inside the head so I can change the eyes decal over time to make it look animated when they blink)
The issue might be that it cant find a face inside of a player’s head.
U can always try this code.
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
task.spawn(function()
task.wait(1)
local face = Character.Head:FindFirstChild("face")
if face then
face:Destroy()
end
end)
end)
end)
Maybe double check you have the script inside of ServerScriptService. I’m sure you probably already have it in there but it never hurts to double check.