Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Teleport player rotation? (Solved)

Asked by 10 years ago

I'm working on a warp GUI that teleports a player to a position, but when teleporting, my character faces the wrong direction.

Here is the positioning

1torso.CFrame = CFrame.new(Vector3.new(-95.97, 14.59, 263.2))

Is there any way to rotate the character using the CFrame?

Also here is the whole script

01permission = {"Player1"} -- Whitelist.
02 
03texture = "http://www.roblox.com/asset/id?=" --Shirt ID
04 
05function checkOkToLetIn(name) -- This function checks to see if a player is on the whitelist.
06    for i = 1,#permission do
07        if (string.upper(name) == string.upper(permission[i])) then return true end --This makes all names uppercase so that we let in BYNDLEY and byndley.
08    end
09    return false -- If you're not on the Whitelist, do nothing.
10end
11 
12torso = script.Parent.Parent.Parent.Parent.Parent.Character.Torso --Defining the torso
13 
14function onClicked(GUI) -- What happens when you click the button
15    if torso.roblox.Texture == texture then --the shirt
View all 21 lines...

All I need is the player to be rotated 90 degrees.

1 answer

Log in to vote
3
Answered by 10 years ago

You can either use CFrame.Angles, fromEulerAnglesXYZ, or Rotation.

1torso.CFrame = CFrame.new(Vector3.new(-95.97, 14.59, 263.2)) * CFrame.fromEulerAnglesXYZ(0,4,0)

The Y axis interval is 4 because it will take four times to rotate a full 360 degrees using this angle - thus 90 degrees.

Ad

Answer this question