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

How to get players position everytime?

Asked by 7 years ago

I was coding a anticheat I want to teleport the player back to its position

2 answers

Log in to vote
0
Answered by
OfcPedroo 396 Moderation Voter
7 years ago
Edited 7 years ago

Try this in a regular script:

game.Players.PlayerAdded:connect(function(player)
    repeat wait() until player.Character
    while wait() do
        local playerPosition = player.Character.Torso.Position --In here we're using Torso's position
        print(playerPosition) --And the variable is defined! Now we're testing with a simple print()!
    end
end)

If this works, please mark as the solution!

As always, good scripting!

Ad
Log in to vote
0
Answered by
Voltoxus 248 Moderation Voter
7 years ago

By using a while loop,

-- Change the delay to what ever suits you best.
while wait(1) do
    print(tostring(game.Players.LocalPlayer.Character.Torso.Position))
end

Answer this question