I need help with custom character loading!

Hey people of the forums, this is my first post.

  1. What do you want to achieve? Keep it simple and clear!

What I want to do is use GUI buttons to load a rig onto a player’s character
2. What is the issue? Include screenshots / videos if possible!

The issue is that when I click the button to load the rig style onto the character, it doesn’t load.
3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

Anything in the developer hub or the forums I found were not very helpful/didn’t work.

This is the script

local MaxButton = script.Parent:WaitForChild('MaxButton') -- The button to change the character
local Max = game.Workspace.StarterCharacter -- The rig I want to load onto the character

MaxButton.MouseButton1Click:Connect(function()	
	game.Players.LocalPlayer.PlayerGui.CharacterGui.Enabled = false -- To close the GUI
	Max.Parent = game.StarterPlayer --What isn't working
	game.StarterPlayer.LoadCharacterAppearance = true -- I'm not sure if this part is neccesary
end)

When I run the script, it doesn’t give me any errors, so I don’t know what’s wrong.
If anyone can help me with this script, it will be very much appreciated. :slight_smile:

well i get what your trying to do, but setting its parent to game.StarterPlayer doesn’t change the character to that model immediately, it just sets the new default character to that

(also make sure this is in a local script since server side cant access local player, and if u want it to happen on the server side, I recommend using remote events but this is all just if ur doing locally)

the best way to do this is to instead clone the rig and just assign it as the current character of the player,

so do something like this:

local MaxButton = script.Parent:WaitForChild("MaxButton") -- The button to change the character
local Max = game.Workspace:WaitForChild("StarterCharacter") -- The rig for the new character model

MaxButton.MouseButton1Click:Connect(function()
    local player = game.Players.LocalPlayer
    local characterGui = player:WaitForChild("PlayerGui"):WaitForChild("CharacterGui")

    -- Disable the Character GUI
    characterGui.Enabled = false

    -- Clone and set the new character
    local NewChar= Max:Clone()
    NewChar.Parent = game.Workspace

    player.Character = NewChar
    player.Character:MakeJoints() -- the make joints function is deprecated, but use this for simplicity since otherwise you'll have to do it manually (I think) I'm not sure if there's any non-deprecated functions like this...
end)

not sure if this actually works because I haven’t tested it, I also don’t even know if I scripted everything correctly, but try it out and lemme know if it works

It kind of works, but the player camera doesn’t move to the new rig. Do you know how to fix that?

Never mind, I just put the character appearances ( the clothes and meshes) in replicated storage. Then, I just cloned them to the character. It was a lot easier than what I was trying to do.