So the title is unnecessarily long but basically I'm making an RPG game and I got the classic class picker and I want when the player clicks on the class that they want to be like archer, mage you know the classic but I don't know how to that I tried adding an archer model to the starter player then changing that models name to starter character but It didn't work. PLEASE HELP. Thank you.
✓ ANSWER ACCEPTED
So how do i make it so that when the player clicks on a class gui and they spawn in as that class?
1 answer
✓ Accepted answer
Simple, you create a character model and place it in a storage thats replicated on cilent and server. Then upon a function, the player.Character value gets set to the new character model, thats placed in workspace.
TIP: put the humanoid into the new model AFTER the plasyer's character has ben set to it, or the .Died event might trigger and glitch.
EXAMPLE: (this might not work as intended, obviously needs to be changed according to your game so it works.)
local function setPlayerCharacter(player,model)
local clonedModel = game.ReplicatedStorage.CharacterModel:Clone() -- clone new char model
local oldHumanoid = clonedModel:waitForChild("Humanoid") -- wait for humanoid
oldHumanoid.Parent = game.ReplicatedStorage -- temporaraly set humanoid to a placeholder
clonedModel.Parent = workspace -- put character in workspace
clonedModel.Name = player.Name -- name the model accordingly
player.Character = clonedModel -- set player's character
oldHumanoid.Parent = clonedModel -- put in new humanoid
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

7 comments
the second parameter of setPlayerCharacter can be deleted unles you do advanced nbame searching in storage
Can i just invite you to my game so that you can see and help me.
if you want, add me my user is A_Mp5
if you want, add me my user is A_Mp5
if you want, add me my user is A_Mp5
oops idk why i commented 3 times glitch
Accept my fried request. I think that's the only to allow you to edit. And also don't really expect much from the game. I made everything on my own.