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

Hat System not working?

Asked by 9 years ago

I'm trying to make a script allowing certain hats to stay but the rest to best destroyed. Code:

for i,v in next,game.Players:getChildren() do
    for o,b in next,v.Character:getChildren() do
        if b.className=="Hat" then
            b:Destroy()
keepHats={"name","name"}
do
    local keepHat=false
    for _,v in next,keepHats do
        if v==b.Name then
            keepHat=true
        end
    end
    if keepHat==false then
        b:Destroy()
    end 
end 
       end
    end
end 

Answer this question