Changing a character to another character [Update]

hello, some time ago I created a post regarding creating custom characters and changing them to another character.

this is the link to that post:

the post was solved by me after I discovered a way to change characters however it was messy.
the post got a lot of attention but I I think people should use a method that is a lot cleaner.

so I took a bit of time and created a save file with a basic character change system:
custom character updated example.rbxl (31.4 KB)

in this example, you can switch into 3 different test rigs via a gui button.
I used this in past projects and I think its a lot better than what was in the old post.
feel free to poke around and use it to help you create custom character content.

10 Likes

How would you connect this to a proximity prompt?

if you call the new character module using an event from a proximity prompt and provide the proper arguements you should be able to do it that way.

1 Like

How would I make it so that the players spawn with their default roblox avatar, then have the choice later on to switch to the rigs?

Because right now the player is forced to spawn as the starter character I put in, but how can I make it so that they can join the game as their original roblox character, then have the choice to switch to one of the red, green or blue rigs?

1 Like

I figured this one out. You have to switch to a character model that has no humanoid, then add the humanoid after the switch. Otherwise, the humanoid in the model kills both characters.

Hm. I’m still quite confused after looking at your post, maybe you can give a simplified explanation to sum up what you said?

You set the player.Character to the new model. If the model you left has a Humanoid, it dies and is destroyed. If the model you enter has a Humanoid, it dies and is destroyed. Changing ownership of a humanoid = death.

If you want to swap characters, without dying, add the humanoid after swapping. There are several settings in humanoid that will need to be set by script if you do this.

Thats all there is to it.

1 Like

Very cool man. it is actually better than using Humanoid:SetStateEnabled(Enum.HumanoidStateType.Dead,false)

That’s not actually what I was asking, I was referring to the place Mantorok4866 made, when you join the place, it automatically sets you to a custom character, then you have the choices to switch between characters.

My question is, how do I let the player join with their own roblox avatar instead, THEN be allowed to switch characters via the UI in game.

I know it’s because there is a StarterCharacter but when I remove it, it still doesn’t change anything

if there is no starter character in that folder, there’s nothing to change into. If I remember correctly, this game did not figure out how to bypass death. It may have changed the starter character by script, which defeats your efforts to remove it.

I will take a look when I get back to a computer, but I suggest looking around for the backup copy of that character. Deleting that should break the code that keeps you from using your character.

1 Like

OK, this game defaults to the 3 dummies shown. It’s embedded in the CharacterAdded event, which includes the initial loading. This game does embrace character death when swapping. If you want to use this game as a model, but include the player’s avatar as the default, you will have to create a 4th dummy (client side, so that it can vary by player). It’s not a trivial adjustment.

I recommend building your own. Here’s the lines you must include:

			local hum = plr.Character.Humanoid:Clone()			
			local animate = plr.Character.Animate	--animate script
			plr.Character = newChar -- new model, no humanoid
			animate.Parent = plr.Character
			hum.Parent = plr.Character