How do I change the StarterCharacter without losing Character Scripts

I want to make a character selection menu in my game but I’ve had a few problems.

The problems are that the character is not changing.

I have tried to set the player,character to the rig but the character scripts in my character don’t transfer over. I have also tried to replace the starterplayer rig through a script, and then resetting the character but that doesn’t seem to change the character.

I want the character to change rigs, but I don’t want to loose the GUI data, and the StarterCharacterScripts.

What I have currently is that when a gui button is pressed, it fires an event deleting the old startercharacter and replacing it with a different rig in the replicated storage, but it doesn’t seem to work. Here is my script:

LocalScript in GUI:

Desc.Buttons.Select.MouseButton1Click:Connect(function()
	if CharacterVal == "CharacterOne" then
		game.StarterPlayer:FindFirstChild("StarterCharacter"):Destroy()
		local StarterCharacter = game.ReplicatedStorage.Characters.CharacterOne:Clone()
		StarterCharacter.Parent = game.StarterPlayer
		StarterCharacter.Name = "StarterCharacter"
		game.ReplicatedStorage.Characters.Reset:FireServer(1,1)
	elseif CharacterVal == "CharacterTwo" then
		--Run for character 2 and so on (You get the Idea)
	end
end)

ServerScript in ServerScriptService:

game.ReplicatedStorage.Characters.Reset.OnServerEvent:Connect(function(plr, character)
	game.ReplicatedStorage.Characters.Reset:FireAllClients(plr, character) -- Just so other local scripts can access this information
	wait(1)
	plr:LoadCharacter()
end)

Thank you for your time!
(BTW I’m new to DevForum, sorry if it doesn’t make sense.)

1 Like

Please, I need to know as soon as possible.

You can use the function Humanoid:LoadDescription which takes a HumanoidDescription and applies it to the character without respawning it. As far as I know, this method doesn’t allow for any custom characters, however as long as you are using a character that could be created in the avatar creator, you should be good.

To get a HumanoidDescription, you can either create a new Instance of it and edit the properties manually, or you can alternatively use game.Players.GetHumanoidDescriptionFromUserId which will return a HumanoidDescription from a user, which you can save somewhere in your game and later apply using LoadDescription.

Thanks, I will have to try that.