How can I change the player's entire rig

I am creating a game, where players can have in-game characters. How can I change the LocalPlayer’s avatar into a custom made avatar using a script?

This helped me a lot when I needed to do something like this:

How to make a character morph? - Help and Feedback / Scripting Support - Developer Forum | Roblox

It’s pretty simple!

• Clone the character to workspace. (on the server)
• Go to the Player instance, and then set the “Character” value to your newly cloned character. (on the server)
• Also set the “CameraSubject” value on the players CurrentCamera to your newly cloned characters Humanoid (on the client)
• Then delete the players old character. (on the server)