[CLOSED]Copy the avatar of the player joined into a custom Startercharacter

Really? If so thanks for letting me know about it!

1 Like

Alright, here. This should help!

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		task.wait(5)
		
		local customCharacter = script:WaitForChild("StarterCharacter"):Clone()
		
		for i, accessory in pairs(character:GetChildren()) do
			if accessory:IsA("Accessory") then
				print(accessory.Name) -- Optional (just checking)
				accessory.Parent = customCharacter
			end
		end
		
		task.wait(2.5)
		
		character = customCharacter
		
		print("Character changed for " .. player.Name)
	end)
end)

Plus: Found a post. It should help!

Hey so that doesnt seem to work either, it doesnt give me the rig, and it deletes my accessory’s

1 Like

Can you check the post I sent you? That should help.

1 Like

Hey so I checked it out and did what he did, and even tired what someone replied to him did, and still not working correctly.

Refer to Players | Roblox Creator Documentation (just noticed that GetCharacterAppearanceSync was deprecated) Players | Roblox Creator Documentation for getting the player accesories instead of polling at CharacterAdded (as it is a bad practice, it also does not gurantee all of the accesories will be there by 5 seconds later)

Could you help me try and swap the rig for my custom one, cause I have been looking for an hour and trying everything I see and I have got nothing.

Alr here I have an example for u.

local customChar = script.StarterCharacter

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        for i = 0, 5, 1 do
            game:GetService("RunService").Heartbeat:Wait() -- allow all the parts in the character to load
        end
        local clone = customChar:Clone()
        for i, v in pairs(char:GetDescendants()) do
            if v:IsA("Accessory") then
                v:Clone().Parent = clone -- u can set the position too but uh idk
            end
        end
        plr.Character = clone
        clone.Name = plr.Name -- not needed but for organization, u dont want 10 things named "StarterCharacter" in workspace :troll:
        clone.Parent = workspace
    end
end

Watch out for typos i wrote this in a hurry. or u could try using what @XDify01 said. If you want I can give u a detailed explaination.

1 Like

Whenever I try to look around or walk I am always stuck in this exact position

Alr, so thats bcz some part in ur model is anchored.

Everything is unanchored though

so there is something called humanoid description you can copy the humanoid description and paste it using this link (humanoid description is located in player character → humanoid → humanoid description)

1 Like

I literally used this script a day ago and it worked fine. Well then is ur humanoid walkspeed more than 0?
other than that u could replace my script with this:

local customChar = script.StarterCharacter

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        for i = 0, 5, 1 do
            game:GetService("RunService").Heartbeat:Wait() -- allow all the parts in the character to load
        end
        local clone = customChar:Clone()
        for i, v in pairs(char:GetDescendants()) do
            if v:IsA("Accessory") then
                v:Clone().Parent = clone -- u can set the position too but uh idk
            elseif v:IsA("BasePart") then
                v.Anchored = false
            end
        end
        plr.Character = clone
        clone.Name = plr.Name -- not needed but for organization, u dont want 10 things named "StarterCharacter" in workspace :troll:
        clone.Parent = workspace
    end
end

I think HumanoidDescriptions would be the best approach to this. I believe they should still work on a custom rig like this as long as it is setup correctly. You’ll want to be using game.Players: GetHumanoidDescriptionFromUserId() and Character.Humanoid:ApplyDescription()

You can either wait until the Character Spawns and use the ApplyDescription method as above, or set game.Players.CharacterAutoLoads to false and set up your own character loading system utilizing LoadCharacterWithHumanoidDescription

2 Likes

@SteveoAttano

Can you show us how is yout custom character structured? I will write a script if I can

Hey I appreciate the offer to help but someone has already helped me solve the problem.

1 Like

You should mark the post as solved then, I unfortunately seen your message late but I’ve written this code using HumanoidDescription (not tested)

local Players = game:GetService("Players")
local Debris = game:GetService("Debris")
local StarterCharacter = script.StarterCharacter

Players.PlayerAdded:Connect(function(jplr: Player)
	jplr.CharacterAdded:Connect(function(oldchar)
		local modchar = StarterCharacter:Clone()
		local modcharhum = modchar:FindFirstChildWhichIsA("Humanoid")
		
		--// fetch HumanoidDescription
		local success: boolean, humDesc: HumanoidDescription?, tries: number
		tries = 0
		repeat
			tries += 1
			success, humDesc = pcall(Players.GetHumanoidDescriptionFromUserId, Players, jplr.UserId)
		until (success and typeof(humDesc) == "Instance" and humDesc:IsA("HumanoidDescription")) or (tries > 3)
		
		if success and humDesc then
			modcharhum:ApplyDescription(humDesc)
			jplr.Character = modchar
			Debris:AddItem(oldchar, 1/30)
		else
			warn("Failed to setup character, unable to get HumanoidDescription.\n", humDesc)
		end
	end)
end)
1 Like

They didnt solve it on this post

But thank you for trying to help me, seriously thank you so much.

1 Like

If you still can’t get it to work, it most likely means your character is not really the same as R15/R6 rigs so if that is the case then, try getting the original character from one of those functions, go through every accesory, manually reposition (take in account for the custom position datas on the Accesory aswell btw) and weld them with Motor6D/Weld, then override the character. (make sure to also remove the old character and set the camera to the humanoid on the new character at the client)

1 Like