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

How can i remove package from a player?

you see i need to have a default package on a R15 player an example would be:

From: http://imgur.com/a/ZiRgReD

To:https://imgur.com/a/OdKzRbp

i have written a script which would use a empty player and copy the player item over to that but its far from working

local Players = game:GetService("Players")


function onPlayerAdded(player)
	local model = script.Parent.StarterCharacter:Clone()  --empty block model 
    repeat wait() until player.Character
    wait(1)
    model.Parent = game.Workspace
    for index, child in pairs(workspace:GetChildren()) do
	    if child.Name == player.name then
		   for index, subchild in pairs(child:GetChildren()) do
			  if subchild:IsA("Accessory") then
				 subchild.Parent = model
			  end
			    if subchild:IsA("Shirt") then
				 subchild.Parent = model
			  end
			  if subchild:IsA("ShirtGraphic") then
				 subchild.Parent = model
				 
			  end
			  if subchild:IsA("Pants") then
				 subchild.Parent = model
				 
			  end
			
		   end
	    end
    end
wait(2)
player:Destroy()
model.Name = player.Name
end

 
--When a player joins, call the onPlayerAdded function
Players.PlayerAdded:connect(onPlayerAdded)
 

the script would copy the empty model to starter player and upon rest show changes but then it messes up upon another player joining is there an simpler (and less abusive to the server) way which i could do this?

1 answer

✓ Accepted answer

R15 Packages are more complicated than R6 was, in fact, you have to create your own R15 Default Rig as Roblox doesn't have one and then use the following script from the wiki to equip the Default Rig.

https://wiki.roblox.com/index.php?title=R15_Compatibility_Guide#Package_Parts

Hence, removing a package from a player does not exist but you would be equipping a different package, that is the Default Rig which you would have made.

2 comments

0

Thank you for the response.I will have a look at the Wiki and thanks for leading me to the right 'way' i shall say :P

0

Yeah and i am back again(e.e) what would be an example of an package?

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