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

How to Rotate a Player?

I have this script which teleports a player. However, when teleported, the player is facing opposite of how I want it to face. How can I fix this?

home = game.Teams.Home
away = game.Teams.Away



wait(7)
local Players = game.Players:GetPlayers()
	for i = 1, #Players do
	if Players[i].Team == home then
	local spawn = game.Workspace.Offense.Part
	Players[i].Character.Torso.CFrame = CFrame.new(spawn.Position)
	end
end

1 answer

✓ Accepted answer

we could make the player face the back of its torso via CFrames, making the player face the right way(also if u didnt know already CFrames have a Position and a lookAt, like CFrame.new(Position, LookAt)):

home = game.Teams.Home
away = game.Teams.Away



wait(7)
local Players = game.Players:GetPlayers()
    for i = 1, #Players do
    if Players[i].Team == home then
    local spawn = game.Workspace.Offense.Part
    Players[i].Character.Torso.CFrame = CFrame.new(spawn.Position, (Players[i].Character.Torso.CFrame * CFrame.new(0,0,-Players[i].Character.Torso.Size.Z)).p)
    end
end

1 comment

0

Thank you!

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