How to make a Character Selection GUI?

I want to make it so when you click a button it will turn you into someone else I’ve tried many ways to do it and no youtube tutorials are either outdated, not working, or giving me a free model that I just have to change the values of or something if anyone could help me with this it would be much appreciated and whoever is reading this I hope you have an incredible rest of your day! :smiley:

5 Likes

You could do this by having the different characters in ReplicatedStorage, then when a button is clicked, it deletes the players current character and replaces it with the selected character from ReplicatedStorage.

3 Likes

Assuming you mean load another player’s character onto a player, you would use this.

local desc = game.Players:GetHumanoidDescriptionFromUserId(UserId)
humanoid:ApplyDescription(desc)

The UserId must be the int user id of the character you want to load, and the humanoid must be the humanoid of the character you want to load it on.

1 Like

I’ve actually done something similar last week.
Disclaimer: It was written in Knit so translating it might get confusing

  1. You gotta bind a function that would fire remote event to the server.
  2. Grab the model from server storage (on the server) and parent to workspace. (it is best to name model after player)
  3. Set character to the model. player.Character = newModel
  4. Grab player’s old cframe and set new model to that cframe.
  5. Extra: Loop through the model and unanchor parts. (best to do this just in case.)

If you want to switch to another character in server. use @Alexplazz’s method.

edit: i can show you my code, but it is written in Knit; so it’s not too beginner friendly.

4 Likes

StackOverFlow, it worked ok but for some reason it changes my camera in weird ways this is my script please tell me if I did anything wrong ;-;

Local Script: local gui = script.Parent

local player = game.Players.LocalPlayer

gui.MouseButton1Click:Connect(function()

gui.RemoteEvent:FireServer()

end)

ServerScript: local gui = script.Parent

gui.RemoteEvent.OnServerEvent:Connect(function(player,Mouse)
local char = player.Character
local change = game.ServerStorage.CharacterDummy:Clone()
change.Parent = workspace
player.Character = change
change.HumanoidRootPart.CFrame = char.HumanoidRootPart.CFrame
end)

But thank you for actually willing to help me and everyone else :smiley:
oh and it also says “Infinite Yield Possible on Flaming_Lion75” im not sure what that means though

3 Likes

Acquire the humanoid description of the desired character through either API calls or local storage, then apply the description to the player’s current character.

3 Likes

Hello i know its been a long time but i would love to have a look at it if that’s okay with you

1 Like