Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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

1 comment

0

There isn't a "Character" index of the table returned by GetPlayers.

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.