I’m making a script that changes the players rig with there accessories and body colors to the Roblox Boy package (2016). I’m having issues though as the player won’t respawn, the animations don’t work at all, and I’m getting no errors.
Here’s the script
local Rig = script:WaitForChild("Rig")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(char)
char.Animate:Destroy()
local accessoryTable = {}
local clothingTable = {}
for i, v in pairs(char:GetChildren()) do
if v.ClassName == "Shirt" or v.ClassName == "ShirtGraphic" or v.ClassName == "Pants" then
table.insert(clothingTable, v:Clone())
v:Destroy()
end
end
for i, v in pairs(char:GetChildren()) do
if v.ClassName == "Hat" or v.ClassName == "Accessory" then
table.insert(accessoryTable, v:Clone())
v:Destroy()
end
end
local characterRig = Rig:Clone()
characterRig.Parent = game.Workspace
characterRig.Name = player.Name
for i, v in pairs(accessoryTable) do
local accessory = v
accessory.Parent = characterRig
end
for i, v in pairs(clothingTable) do
local clothing = v
clothing.Parent = characterRig
end
local bodyColors = char["Body Colors"]:Clone() char["Body Colors"]:Destroy()
bodyColors.Parent = characterRig
player.Character = characterRig
task.wait(.21)
local healthScript = script.Health:Clone()
healthScript.Parent = characterRig
local Animate = characterRig.Animate
characterRig.Animate.Disabled = true
characterRig.Animate.Disabled = false
healthScript.Disabled = true
healthScript.Disabled = false
char:Destroy()
local StarterCharacter = characterRig:Clone()
StarterCharacter.Name = "StarterCharacter"
StarterCharacter.Parent = game.StarterPlayer
end)
end)