Recently, I have been working on a Admin Panel of sorts and got to the idea of being able to create a player’s avatar through a gui. I have tried spawning a character model through humanoid Description and through a player’s UserID. Both have failed.
local script:
script.Parent.MouseButton1Down:Connect(function()
local target = script.Parent.Parent.Player.Text
script.Parent.Parent.LoadScript.LoadCharacter:FireServer(target)
end)
remote event script:
script.LoadCharacter.OnServerEvent:Connect(function(player, target)
local PlayerService = game:GetService("Players")
local TargetId = PlayerService:GetUserIdFromNameAsync(target)
print(TargetId)
local HumanoidDescription = PlayerService:GetHumanoidDescriptionFromUserId(TargetId)
print(HumanoidDescription)
PlayerService:CreateHumanoidModelFromDescription(HumanoidDescription)
end)
First off, load character is used to basically force respawn somebody so it is not able to be used in this way. Second, I have a leaderboard system that displays the highest players model in a throne. I use this function to first off get the players appearence.
local charModel = game.Players:GetCharacterAppearanceAsync(playerId)
I then clone a pre made dummy thats in serverstorage into the workspace where I then loop through the model and put all the accesories and stuff from the character appearence model onto the dummy which I can then maniplute to sit in the throne.
Here is the full code with all of this togethor.
local clone = game:GetService("ServerStorage"):WaitForChild("Dummy"):Clone()
clone.Parent = workspace
local charModel = game.Players:GetCharacterAppearanceAsync(playerId)
for _,v in pairs(charModel:GetChildren()) do
v.Parent = clone
end
Once you have this I recommend just using viewport frames to add the players character into the UI. Dont forget to mark this as a solution if this helps
that means your not passing a players id, that means your passing a string and not what it expects. You need to pass the Id and not the name or the player itself.