#Why doesn't this remove my hats when i touch it
23 messages · Page 1 of 1 (latest)
theres is probably so many errors if this touches other parts
u should start by checking if it is a character
i dont know it was on a tutorial-
function onTouched(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum then
for i,v in pairs(hit.Parent:GetChildren()) do
if v:IsA("Accessory") then
v:Destroy()
end
end
for i,v in pairs(hit.Parent:GetChildren()) do
if v:IsA("Hat") then
v:Destroy()
end
end
end
end
script.Parent.Touched:Connect(onTouched)
``` this should do
thx
yw
@calm edge can you help me with one more script rq
im trying to make it equip when equipped is true
is it a tool?
no its an accessory
are u trying to put a hat to a player?
yes