How to make a player face the right way when being teleported?

Hey! :wave:

I’m trying to make a script that teleports all players on a specific team to a different location for each of them. This works, however it makes them face the wrong way when they are teleported. Could I have some help with changing up this script so it makes the player face the register rather than to the right? Thanks! :heart:


local Teams = game:GetService("Teams")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local remotes = ReplicatedStorage.Remotes

local spawns = workspace.TeleportParts

	--if player.Team ~= Teams.Interviewer then
	--	return
	for spawnIndex, interviewee in ipairs(Teams.Interviewee:GetPlayers()) do
		if not interviewee.Character then
		interviewee.Character.HumanoidRootPart.CFrame = spawns[tostring(spawnIndex)].CFrame *, 2, 0)

I’m not that good with CFrame, but I think you can use something like this:

interviewee.Character.HumanoidRootPart.CFrame * CFrame.Angles(0,math.rad(90),0)

1 Like

Thanks for your response. I’ve altered the script a bit, and your code comes up in red. Any idea why?

1 Like

Thats because you already used the cashier.blahblahblah, you should add * CFrame.Angles(0,math.rad(90),0) after the, 2, 0)

1 Like

You could just make the teleport brick or whatever facing the way you want the person to face. That would be the easiest in my opinion then making another line of code. :slight_smile:

1 Like

Thank you! Give me a moment to see if this works.

Hm, how would I do that? charss

Roblox removed the stud facing or whatever its called. It basically allowed you to change the stud type and see the direction of the part. Luckily, someone made a plugin to allow you to see the directions of a part. Finale of Part Surface Changes: No More Hinges - #82 by tukars

Unfortunately, this doesn’t work for some reason. I don’t think any errors are coming up, either. Any ideas?

EDIT: Nevermind, this WORKS! Thank you so much. :heart:

1 Like

They’re saying that this part is a part in your workspace, find it and rotate it then test again.

1 Like

No problem! I am always happy to help. :slight_smile:

1 Like