I was coding a anticheat I want to teleport the player back to its position
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!
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