Hi there, so I’m not sure about this so I decided to ask this question here.
So basically in my place I want to make it so someone spawns with the block rig but with their accessories still on them.
Is there a way to do this or am I just supposed to spawn them with a block character using the StarterCharacter method then import all their accessories to their character? If so, how would I check what accesories they have in their character?
You can do this by having a newly created block rig via the animation rig creator and adding the accessories to the rig and setting their character to the rig.
Firstly, put the rig inside ServerStorage and then insert a Script into ServerScriptService.
Secondly, define the variables you’ll need. This will be Players service and the rig.
local ServerStorage = game:GetService("ServerStorage")
local Players = game:GetService("Players")
local rig = ServerStorage.Rig --Adjust this as required
Thirdly, create the main handling function which takes the character as a parameter and clones the rig, then applying the new accessories and setting their character to the rig.
This will be in a CharacterAppearanceLoaded inside PlayerAdded:
Players.PlayerAdded:Connect(function(plr)
plr.CharacterAppearanceLoaded:Connect(function(character)
local clone = rig:Clone()
local spawnPos = character:GetPrimaryPartCFrame() --Where they spawned
for _, instance in pairs(character:GetChildren()) do
if instance:IsA("Accessory") then
instance:Clone().Parent = clone
end
end
player.Character:Destroy()
player.Character = clone
clone:SetPrimaryPartCFrame(spawnPos)
end)
end)
If you want their clothing too then check if the instance:IsA("Clothing") and then parent it to the clone
Don’t use StarterCharacter, use HumanoidDescriptions. You can reference code from the following support request about a script that depackages characters: