I’m making a battlegrounds game where players can change their character at anytime, each of which have their own set of animations. How can I replace the player’s character, while maintaining the same functionality of the original character?
Hey! I’m not sure what you mean by
You could try morphing it? Idk what you mean by replacing it like a whole new character? Elaborate please, I am confused.
local newCharacter = game.ServerStorage.Character:Clone()
newCharacter.Parent = player.Character.Parent
newCharacter:PivotTo(player.Character:GetPivot())
plr.Character = newCharacter
something like that
This implementation uses different starter characters for different teams:
(this message was directed to OP, not EzraPig)Well here is a morpher function :
local function Morpher(Char,plr,Desired_Position)
local charClone = Char:Clone()
charClone.Name = plr.Name
plr.Character = charClone
local rootPart = charClone:FindFirstChild("HumanoidRootPart") or charClone:FindFirstChild("Torso")
if rootPart then
rootPart.CFrame = Desired_Position
end
charClone.Parent = workspace
end
if that is any help. This script was sourced from a Shrek Morpher™
3 Likes
I’m trying to replace the player’s current character with a new character.
local StarterCharacter = game.ServerStorage.StarterCharacter --starter character in storage
local function OnPlayerAdded(Player)
local function OnCharacterAdded(Character)
if Character.Name == "StarterCharacter" then return end --avoids creating infinite starter characters
local StarterCharacterClone = StarterCharacter:Clone() --clone starter character
Character:Destroy() --destroy old character
Player.Character = StarterCharacterClone
StarterCharacterClone.Parent = workspace
end
Player.CharacterAdded:Connect(OnCharacterAdded)
end
game.Players.PlayerAdded:Connect(OnPlayerAdded)
I just used a random starter character from the toolbox:
1 Like
yes, mine and his suggestions will work. You just need to get a character.
