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.

25 Likes

How would you connect this to a proximity prompt?

1 Like

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.

2 Likes

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?

1 Like

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.

4 Likes

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

2 Likes

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

1 Like

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.

2 Likes

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
1 Like

I’m think this works good, but camera isn’t looking to head. Camera looks to you Torso. I’m too tried to did character changing and this looks good.
image

Fixcamera script:

local remoteevent = game.ReplicatedStorage:WaitForChild("RemoteEvent")

remoteevent.OnClientEvent:Connect(function(humanoid)

print(humanoid)

game.Workspace.CurrentCamera.CameraSubject = humanoid

end)

Characterchange:

game.Players.PlayerAdded:Connect(function(player)
game.ReplicatedStorage.RoundStarted.Changed:Connect(function(value)
	print(value)
	if value then
		if player.Character:FindFirstChild("Humanoid") then
			print("found")
				local hum = player.Character.Humanoid
				player.Character = workspace.Dummy1
			game.ReplicatedStorage:WaitForChild("RemoteEvent"):FireClient(player,game.Workspace.Dummy1.Humanoid)
			print("fired")
		end
	end
	end)
end)

It’s looks very simple, but its works. You can also add a lot more here, for example, so that the name changes to the name of the player and so that after death the player can respawn.But, this is just an example of how to use it, Good luck!
Edit: Perhaps your post was created in 2021 and everything worked fine before, but this is just my guess

2 Likes

I solved this problem :wink:

1 Like

local Character = —
local ChangeInto =—

local OldNeck = Character.Humanoid.RequiresNeck
local OldJointsOnDeath = Character.Humanoid.BreakJointsOnDeath
local OldPlatformStand = Character.Humanoid.PlatformStand
local OldCFrame = Character.HumanoidRootPart.CFrame

Character.Humanoid.RequiresNeck = false
Character.Humanoid.BreakJointsOnDeath = false
Character.Humanoid.PlatformStand = true

for i,v in pairs(Character:GetChildren()) do
if not v:IsA(“Humanoid”) and not v:IsA(“Script”) then

  v:Destroy()

end
end

wait()
local Model = ChangeInto:Clone()
Model.Parent = Character

for i,v in pairs(Model:GetChildren()) do
if not v:IsA(“Humanoid”) and not v:IsA(“Script”) then
v.Parent = Character
else
v:Destroy()
end
end
wait()
Character.Humanoid.RigType = ChangeInto.Humanoid.RigType
Character.Humanoid.RequiresNeck = OldNeck
Character.Humanoid.BreakJointsOnDeath = OldJointsOnDeath
Character.Humanoid.PlatformStand = OldPlatformStand
Character.HumanoidRootPart.CFrame = OldCFrame
Character.Humanoid.HipHeight = ChangeInto.Humanoid.HipHeight

How do I change the character without deleting the old character?

anybody still there? how do i bring back the animations cause mines gone

I haven’t looked at this post in a while, are you trying to reload default animations or load custom animations?

i want to load default animations like walking or jumping

looks like since a startercharacter is used there arent any default roblox scripts. what you could do is playtest as a normal r6 character in either this save or another one, then copy over the default scripts. then just clone the default scripts into a spawned character which will load in all the animations you would usually get.