Title is basically self explanatory.
In this script here, the hats will not be removed. The problem is on line 5. I've tried using :Destroy(), :Remove() and :ClearCharacterAppearance() but none have worked. All other lines of the script work, except for line 5.
wait(0.1) local player = game.Players.LocalPlayer local mouse = player:GetMouse() player:ClearCharacterAppearance() player.CameraMode = Enum.CameraMode.LockFirstPerson player.Character.Humanoid.WalkSpeed = 10 player.Character.Humanoid.Name = "Hoomanoid" mouse.Icon = "rbxassetid://251444305"
Any help is much appreciated, thanks!
You could do this:
repeat wait() until p.Character local char = p.Character for _,v in pairs (char:GetChildren()) if v:IsA("Hat") then v:destroy() end end
EDIT:
Hierarchy:
Script:
game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(char) repeat wait() until char.Head for _,v in pairs (char:GetChildren()) if v:IsA("Hat") then v:Destroy() end end end) end)