I want to save a player's position coordinates.. But I don't want to use a loop

So saving a players position coordinates is kind of a drag if you have to use a loop just to update a Vector3 value, or a similar value. Does anyone know a more efficient way of doing this?

You could use the GetPropertyChangedSignal event. I believe this is how it would work:

local posTable = {}
local player = game.Players.LocalPlayer
local character = player.Character
if not character then
	character = player.CharacterAdded:Wait()
end
local hrp = character:WaitForChild("HumanoidRootPart")

hrp:GetPropertyChangedSignal("Position"):Connect(function()
	table.insert(posTable, hrp.Position)
end
3 Likes

What exactly is your use case?

If you think about it, you might come up with a solution that wouldn’t require you to constantly update a stored position.