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

How would you destroy a players body parts (hats,packages,etc.) that you don't know?

Asked by 9 years ago

Like in murder mystery when you spawn in the lobby you spawn as a noob but have all you clothes and hats and packages all gone. How do you destroy body parts?

2 answers

Log in to vote
1
Answered by
emite1000 335 Moderation Voter
9 years ago

Have a script that uses the :Destroy()function on body parts every time a player spawns in via :CharacterAdded() or :PlayerAdded().

0
Yes but how do u destroy a hat or package that you don't know what the name is cutenipples101 0 — 9y
0
One way you could do it is use the ClassName property to check if it is a hat or a package. Just do "if x.ClassName == Hat then x:Destroy()" (x is the hat). emite1000 335 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

try this

game.Players.PlayerAdded:connect(function(plr)
    plr.CharacterAdded:connect(function()
        wait(2)
        local bp = plr.Character:GetChildren()
        for i = 1, #bp do
           if bp[i]:IsA("Hat") or bp[i]:IsA("Shirt") or bp[i]:IsA("Pants") then
               bp[i]:remove()
           end
        end
    end)
end)
0
also, don't set the wait to less than 1, or it might not work lowvillan 10 — 9y

Answer this question