Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to fix the script? , (hair morph remover and giver scripts)

Asked by 3 years ago

When I'm using it one time, it removes the hair, but when I'm trying to put another hair it doesn't let me (the giver doesn't work after) Any suggestions to fix it?

function onTouched(hit) 
    local d = hit.Parent:GetChildren() 
    for i=1, #d do 
        if (d[i].className == "Model") then 
            d[i]:remove() 
        end 
    end
end 

script.Parent.Touched:connect(onTouched) 

Answer this question