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 a player when it touches a part?

local block = script.Parent
local plr = game:GetService("Players")

block.TouchEnded:Connect(function(player)
	local hum = player.Parent:FindFirstChild("Humanoid")
	wait()
	hum.CFrame = CFrame.new(0,0,0)
end)

Here's the script but I have no idea how to make the player teleport. Do I use the humanoid or the character?

1 answer

Pretty use you gotta use the Humanoid root part, so it will look something like this:

local player = game.Players.LocalPlayer
local character = player.Character

if player.Character:FindFirstChild("HumanoidRootPart") then
	player.Character.HumanoidRootPart.CFrame = game.Workspace.{PARTNAME}.CFrame
end

Hope this helped!

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