hi devs!
So i wanna make a script that when a player joins, a dummy will wear the player that joined avatar.
How can i achieve this?
1 Like
Hi there!
To make a character/rig wear the avatar of a player, you can make use of HumanoidDescriptions, GetHumanoidDescriptionFromUserId, and ApplyDescription respectively.
In the script example below, I made a template dummy to clone and put into the workspace, but if you want a specific dummy to do this for, then disregard this.
local dummy = script.Rig
local function playerJoined(player)
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:FindFirstChild("Humanoid") or character:WaitForChild("Humanoid")
local hDescription = game:GetService("Players"):GetHumanoidDescriptionFromUserId(player.UserId)
local newDummy = dummy:Clone()
newDummy.Parent = workspace
newDummy.Humanoid:ApplyDescription(hDescription)
end
game:GetService("Players").PlayerAdded:Connect(playerJoined)
Hope this helps!
1 Like