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

How do i Detect a player pos with a script?

Asked by
Troevan -8
4 years ago

i need a script that can detect a players position and tell the player it.

1 answer

Log in to vote
0
Answered by 4 years ago

To get the players position, you can use their HumanoidRootPart, because every rig type, whether R6 or R15, uses the HumanoidRootPart.

local player = game:GetService("Players"):FindFirstChild("Player1") -- Replace Player1 With the player your trying to find the Position for.

local character = player.Character or player.CharacterAdded:Wait()
local root = character:WaitForChild("HumanoidRootPart")
print(root.CFrame.p)
0
Try putting an event that fires every time the HumanoidRootPart's position is changed, and you should change the FindFirstChild part with LocalPlayer. Mr_Unlucky 1085 — 4y
Ad

Answer this question