Setting a Player's package

Hi, I am trying to set a player’s package in this function by setting the meshid but that doesn’t work. Is there any better way to doing this or anyone knows how to fix this? Here is my code:


function module.DressPlayersTest()
	local character

	for i, player in pairs(game.Players:GetPlayers()) do
		
		for _, playerObject in pairs(player.Character:GetChildren()) do
			if playerObject:IsA("Accessory") or playerObject:IsA("Shirt") or playerObject:IsA("Pants") or playerObject:IsA("BodyColors") then
				playerObject:Destroy()
			end
		end
		
		if game.ReplicatedStorage.Values.DebugMode then
			for _, object in pairs(game.ReplicatedStorage.DebugCharacters.bramp1996:GetChildren()) do
				if object:IsA("Accessory") or object:IsA("BodyColors") or object:IsA("Shirt") or object:IsA("Pants") then
					object:Clone().Parent = player.Character
				end
				if object:IsA("MeshPart") then
					for c, playerMesh in pairs(player.Character:GetChildren()) do
						if playerMesh:IsA("MeshPart") then
							playerMesh.MeshId = object.MeshId
						end
					end
				end
			end
	end
end
1 Like

To add to this, changing the meshid is restricted. So how can I set one’s package?

1 Like

You could use humanoid descriptions. When I want to set the package of a player to the default bear package I’d do something like this:

local PlayerService = game:GetService("Players")

function DressPlayer(player)
	wait() -- I just put this in here in case the players character hasnt loaded in yet
	local Character = player.Character
	local Humanoid = Character:WaitForChild("Humanoid")
	local CurrentDescription = Humanoid:GetAppliedDescription() 

	CurrentDescription.Head = 0 -- change these 0's to whatever the asset id is for your package
	CurrentDescription.Torso = 0
	CurrentDescription.LeftArm = 0
	CurrentDescription.RightArm  = 0
	CurrentDescription.LeftLeg = 0
	CurrentDescription.RightLeg = 0
	Humanoid:ApplyDescription(CurrentDescription) 
end

PlayerService.PlayerAdded:Connect(DressPlayer)

if you have a certain package you want the player to have, I think you would just change all the 0’s to the asset id for that package.

5 Likes