This question is kind of common, and honestly from what I’ve seen there was never a perfect answer to it.
Because any found solution had a small flaw in it.
For example, a very simple way to do this is: you replace the first StarterCharacter model and replace it with the other character you want, than you kill the character or player:LoadCharacter() which would respawn the character without killing him and voila he will have his new character, but this was a hacky way of doing it that wasn’t secure nor stable, since the StarterCharacter is supposed to represent the starting character for ALL players and not just one, so you have to replace the startercharacter from a local script, which can be easily accessed by an exploiter. And the whole idea of replacing the startercharater seemed kind of wrong even though it would work as wanted.
So another idea people came up is changing the player.Character, which is much simpler and it literally only required you to
player.Character = the new character
Which offered more simplicity and security but was is well unstable.
Yeah that’s what I said, I told you that method to show that even though it’s correct it’s not advised. I showed that exact post because that method was used so just a proof that it works.
But I recommend doing the player.Character = <new character> method, and I don’t think you even need to :LoadCharacter() I assume changing the character will respawn the player, if it doesn’t, use LoadCharacter().
Another thing, when the character respawns it might look a bit not professional so it is a cool idea to make some camera manipulation to prevent the player from seeing the respawning character that just falls from the sky.
if you spawn in the character you want it to be changed to in the workspace. set the cframe of the rootpart to the current characters cframe and delete the current character. in players change the players character property to your new one. then change the camera subject of the workspace.currentcamera to new characters humanoid (on the clients side). this should work i guess
I found a solution that seems to work perfectly, use it in most of my games.
You can use this code (in a server script. This is just an example, but it assumes a remote was fired from the client to the server, carrying the name of the character that needs to be changed into. That character should be located in ReplicatedStorage):
local remote = --remote
local OldChar = sender.Character
local newChar = game.ReplicatedStorage:FindFirstChild(characterName.Name):Clone()
newChar.HumanoidRootPart.Position = Vector3.new(OldChar.HumanoidRootPart.Position)
newChar.Parent = game.Workspace
sender.Character = newChar
I found a way to do it. The code below is an example but can be configured to meet your needs. The key to my approach is to simply change the character model via “player.Character”
local Players = game:GetService("Players");
local char = --custom character;
while true do
local character = char:Clone();
player.Character = character
character.Parent = workspace
note: its very important to assign the character before parenting it to workspace in order for the camera to automatically readjust