Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

'Teleport' the player right where their standing? (So they don't move)

Asked by 9 years ago

Hey guys!

I just want to quickly know to if it is possible to 'teleport' a player into the place they are standing.

This is the script I have so far.

player[i].Character:MoveTo(Vector3.new())

So in the Vector3.new() I need something in the brackets that ensures that the player doesn't move from where they are. (Without this bit of the script, the whole thing breaks so I do need it!)

If anyone has any ideas, please share!

Thanks in advance,

Michael

1 answer

Log in to vote
1
Answered by
Merely 2122 Moderation Voter Community Moderator
9 years ago

The humanoid root part is the center of the character model, so just grab its current position.

local character = player[i].Character
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart then
    character:MoveTo(humanoidRootPart.Position)
else
    -- the player probably just died and his character got deleted
end
Ad

Answer this question