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

How to make a text button that changes players position and looks?

How would I make a text label button on clicked change a players position and looks as in how would I change the players looks to a model or how would I morph the player to something else In my character customization menu

4 comments

0

Did I explain this to were u guys understand or no

0

No I want to change where the player is and also there character

0

Oof that’s not what I meant I was trying to say not where the player looks how the player looks like a block rig or something

1 answer

✓ Accepted answer

What I'd do if you want to change the player's position and where they look is use CFrame.new(Position, lookAt). This is the most common and simple way to do this.

-- First, let's define the button.
Button = script.Parent

-- Now, let's add a function to when the button is pressed.
Button.MouseButton1Click:Connect(function()
	-- Now let's get the main variables we need.
	local Player = game:GetService('Players').LocalPlayer
	local Character = Player.Character or Player.CharacterAdded:Wait()
	local HRP = Character:WaitForChild('HumanoidRootPart')
	-- Finally, CFraming. Change the values accordingly to where you want them to teleport and face.
	HRP.CFrame = CFrame.new(Vector.new(0,0,0), Vector3.new(0,0,0))
end)

You can learn more about CFrame here and here.

1 comment

0

Do not answer requests.

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