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

How would i remove packages, from all players in game?

Asked by 10 years ago

Previously, i asked how to removes shirts/pants. I got that down, and it's working. However, it's not working for packages (CharacterMesh) or Hats.

It's a bug, where when all players are in the lobby. Everyone is clothless, with the right bodycolors i choose for lobby waiting.

However, if someone is wearing a package. It stays on. How would i remove a package, and hat from players. If they have one on?

-Thanks in advance!

2 answers

Log in to vote
-1
Answered by 10 years ago
local gt = game.Players:GetPlayers()

for I,v in pairs(gt.Character:GetChildren()) do
    if v:IsA("CharacterMesh") then
    v:Destroy()
    end
end

ther you go

0
There isn't a "Character" index of the table returned by GetPlayers. User#2 0 — 10y
Ad
Log in to vote
-2
Answered by 10 years ago

I am guessing....

function Respawn(newPlayer)

wait(0.5) print("Respawned") p = newPlayer.Character:GetChildren() for i = 1, #p do if p[i].className == "CharacterMesh" then print("Found") p[i]:remove() local m = Instance.new("Message") m.Parent = newPlayer m.Text = "Character Bodies aren't aloud in this game." game:GetService("Debris"):AddItem(m,4) end end end function Enter(newPlayer)

newPlayer.Changed:connect(function (property) if (property == "Character") then Respawn(newPlayer) end end) end game.Players.ChildAdded:connect(Enter)

Answer this question