#Why doesn't this remove my hats when i touch it

23 messages · Page 1 of 1 (latest)

hidden nymph
#

might be disabling to quick

calm edge
#

theres is probably so many errors if this touches other parts

#

u should start by checking if it is a character

hidden nymph
#

ok

#

how do i do that lo

calm edge
#

wait

#

why are u doing for i?

hidden nymph
#

i dont know it was on a tutorial-

calm edge
#

oh

#

wait

#

let me see if i can make a script

hidden nymph
#

k

#

i also need help on another script if possible

#

well maybe not

calm edge
#
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
hidden nymph
#

thx

calm edge
#

yw

hidden nymph
#

@calm edge can you help me with one more script rq

#

im trying to make it equip when equipped is true

calm edge
#

is it a tool?

hidden nymph
#

no its an accessory

calm edge
#

are u trying to put a hat to a player?

hidden nymph
#

yes