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.
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.
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?
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.
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.
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.
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
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.
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
local OldNeck = Character.Humanoid.RequiresNeck
local OldJointsOnDeath = Character.Humanoid.BreakJointsOnDeath
local OldPlatformStand = Character.Humanoid.PlatformStand
local OldCFrame = Character.HumanoidRootPart.CFrame
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
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.