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

Can anyone help me teleport a player to a vector3?

I'm trying to make it so that the player teleport in a specific area but it doesn't wanna work

local player = game.Players.LocalPlayer

player.Humanoid.HumanoidRootPart.Position = Vector3.new(54.86, 0.5, -77.58)

1 comment

0

Changing the position of the HumanoidRootPart on the client will result in the HumanoidRootPart to be moved instead of the entire character. Use CFrame instead of position.

2 answers

✓ Accepted answer

Well, There Is A New And Better Way To Identify The Character:

local Player - game.Players.LocalPlayer -- // This Is You
local MainPos = Vector3.new(54.86, 0.5, -77.58) -- // MainPos .. MainPosition

local Character = game.Workspace:WaitForChild(Player.Name) -- // New Way To Identify The Character
local HumanoidRootPart = Character:WaitForChild('HumanoidRootPart') -- // Identifying The HumanoidRootPart



HumanoidRootPart.Position = MainPos -- // Setting The HumanoidRootPart Pos To MainPos

3 comments

0

local Character = game.Workspace:WaitForChild(Player.Name) is not a new way of defining the Character, there's obviously a reason why we have a property of the Player which is Player.Character.

1

Changing the position of the HumanoidRootPart on the client will result in the HumanoidRootPart to be moved instead of the entire character. Use CFrame instead of position.

0

Bro Nobody Understands What You Are Saying Why Don't You Just Answer This Question Your Self?

you didn't index character before the humanoid

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait() -- Checking if character is added

if Charcter:FindFirstChild("Humanoid") then -- Checking If there's a humanoid
	Character.Humanoid:FindFirstChild("HumanoidRootPart").Position = Vector3.new(54.86, 0.5, -77.58)
end

2 comments

0

HumanoidRootPart is not a child of the Humanoid. Have you tested your code?

0

Changing the position of the HumanoidRootPart on the client will result in the HumanoidRootPart to be moved instead of the entire character. Use CFrame instead of position.

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