I want to load a Players Character on the CLIENT side with the avatar type R6. This is what i currently tried but it didnt work because the accessories didnt display…
local HumanoidModel = Players:CreateHumanoidModelFromUserId(RandomId)
Rig.Name = UserService:GetUserInfosByUserIdsAsync({RandomId})[1].DisplayName
for _, Child in pairs(Rig:GetChildren()) do
if Child:IsA("Accessory") or Child:IsA("Shirt") or Child:IsA("ShirtGraphic") or Child:IsA("Pants") or Child:IsA("BodyColors") then
Child:Destroy()
end
end
for _, Child in pairs(HumanoidModel:GetChildren()) do
if Child:IsA("Accessory") or Child:IsA("Shirt") or Child:IsA("ShirtGraphic") or Child:IsA("Pants") or Child:IsA("BodyColors") then
Child.Parent = Rig
end
end
HumanoidModel:Destroy()
Players:CreateHumanoidModelFromUserId() creates a character based on what the user has equipped (R6 or R15) so it wouldn’t guarantee to spawn in an R6 Character.
local Players = game:GetService("Players")
local RandomId = 1 -- placeholder
local HumanoidDescription = Players:GetHumanoidDescriptionFromUserId(RandomId)
local HumanoidModel = Players:CreateHumanoidModelFromDescription(HumanoidDescription, Enum.HumanoidRigType.R6)
-- Continue with other stuff from the original code
HumanoidModel.Parent = workspace
Edit: oh and I missed this part until re-reading the post after completing this
The accessories wouldn’t appear because the code deletes any Accessories within the first loop, so checking if Child:IsA("Accessory") would not be needed if you wanted the Character to keep their accessories once it has been spawned in.