Hello.
I’m currently making a game where, when you spawn, you will become a dummy with nothing.
I’m trying tho to get the accessory a player has on their avatar from the profile, since when they spawn they have none.
Is there a way to get which accessories a player had before becoming a dummy?
I found nothing on the web, that’s pretty why i came here.
You can use HumanoidDescriptions. Here’s a simple script I made that works in the way you’d like:
(ServerScript, StarterCharacterScripts)
local rs = game:GetService("ReplicatedStorage")
local player = game.Players:FindFirstChild(script.Parent.Name)
local desc = game.Players:GetHumanoidDescriptionFromUserId(player.UserId)
desc.Name = player.Name
desc.Parent = rs.HumanoidDescriptions --Folder
--The folder can be in many places, and is used to store the HumanoidDescription of the player.
workspace.Dummy.Humanoid:ApplyDescription(rs.HumanoidDescriptions[player.Name]) --Empty dummy
Additionally you can use game.Players:CreateHumanoidModelFromDescription(rs.HumanoidDescriptions[player.Name]
in place of workspace.Dummy.Humanoid:ApplyDescription(rs.HumanoidDescriptions[player.Name]
to create a new model with the player’s avatar, instead of using an already-existing dummy, which can help for multiple players in the same server.
Local dummy = — your dummy
Local Table = Player.Character:GetChildren() — returns a table of all the children of the character
for i = 0, #Table, 1 do
If Table[i].Classname = “Accessory” then
Table[i].Parent = DummyFolder
end
end