I tried using this script to remove a players hat but its kinda broken. Please help
PhantomHead = Phantom.Character.Head
PhantomHats = PhantomHead.GetInstance("Hat")
PhantomHats:Remove()
I tried using this script to remove a players hat but its kinda broken. Please help
PhantomHead = Phantom.Character.Head
PhantomHats = PhantomHead.GetInstance("Hat")
PhantomHats:Remove()
You could remove all player hats by iterating over a table of all of the character's children. It seems as if you didn't define what Phantom is and I would also suggest using Destroy(). This script goes through all of the children, checks whether or not it is a hat object and destroys it if it is but leaves it alone if it is not. Please remember to define what phantom is.
--phantom = -- define who phantom is--
for i, v in pairs(phantom.Character:GetChildren()) do
if v:IsA("Hat") then
v:Destroy()
end
wait()
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
You do not need the wait, it won't lag the game.