Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you transform yourself into a model when you click a button?

The reason I'm asking is because i know this is a tad bit advanced for me, but I enjoy learning. If you know the code could you make notes explaining what you are doing in that line ( this is optional but I would appreciate it). This is essential for the game I'm making and I don't even know where to start lol. Please HALP!

2 answers

Here's a way to clone a player when it clicks a button ( think it is what you asked): Make the button have a script and a click detector. The script should say:

local part = script.Parent -- Declaring what we want to know
local detector = part.ClickDetector -- The thing that will register our click
detector.MouseClick:connect(function(player) -- Calling the click function
local g = player.Character:Clone() -- Cloning the player's character
g.Parent = game.Workspace -- Making the clone in the game
g.Torso.CFrame = player.Character.CFrame + CFrame.new(1,3,1) -- Put the clone near the player
end) -- Ending the function

You may need to have a ready-made morph ready but you would have to put it in a place no players would find it, then when you click the button you would have to make a script that makes your Torso, Right Arm, Left Arm, Right Leg and Left Leg disappear and put the morph onto you.

2 comments

0

Could you possibly give me a code for that lol... im a beginner, unfortunately

1

Your Character is already in a model.A character is a property of Player and it's a reference to the body parts, animations, scripts values etc.

This discussion is preserved as it was. New answers, comments, and votes are closed.