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

How to teleport someone after a cutscene?

I need to teleport someone upon entering, about 3 seconds after they join. I tried

function onPlayerEntered(player)
	wait(3)	
	game.Workspace.Player.Torso.Position = Vector3.new(0, 50, 0)
	
end

Didn't do anything. I am using a spawn part if that is useful.

Thanks,

CallKnuss

1 comment

0

one recommendation use HumanoidRootPart to teleport.

1 answer

A simple fix to your problem would be to move the Humanoid Root by CFraming. This eliminates the outcome of killing the player. Also you need to connect the function, and list variables to gather information on what the HumanoidRootPart is.

Heres the script!

local player = game.Players.LocalPlayer --Identifies the Player
local character = player.CharacterAdded:wait() --Indentifies the character by waiting for for the character to be added into "player"
local root = character:WaitForChild('HumanoidRootPart') --Indentifies the HumanoidRootPart

function onPlayerEntered() --Names the Function
    wait(3) --Waits 3 seconds
    root.CFrame = CFrame.new(Vector3.new(0, 50, 0)) -- Sets CFrame of the HumanoidRootPart to the location of where you want to be teleported
end
game.Players.PlayerAdded:connect(onPlayerEntered()) --Connects the function

I hope this helped, please comment if you have any questions or concerns!

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