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

How to get your player's current position with a LocalScript in a ScreenGui?

Asked by 6 years ago

I have a TextLabel that's supposed to say your player's current position, the TextLabel is in a ScreenGui, is there anyway to do this because I can't figure it out, preferably in a LocalScript but if it has to be in a normal Script then that's fine c:

1 answer

Log in to vote
0
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
6 years ago
local plr = game:GetService("Players").LocalPlayer

local posLabel = script.Parent
while wait(.1) do
    local char = plr.Character or plr.CharacterAdded:Wait()
    local hrp = char:WaitForChild"HumanoidRootPart"
    posLabel.Text = tostring(hrp.Position)
end
0
Thanks! ShiforRBLX 5 — 6y
Ad

Answer this question