How to check if a player moved position, or changed the direction he is looking at?

I am developing an addon for TTT that will set idle people on fire. My current approach is to make a function that is called once every second to check if the players position/direction has changed. However, to do this i need to store the previews X, Y coordinated of the player and the previous direction of the player. The problem is that i don’t know how to store this information and how to get it. I need a variable for the position and the direction for each player, and since the number of players in the game is dynamic, i need to create variables dynamically… I think… Also, i don’t know how to get a list of all players in the game.

Store their pos in a variable, on the next function call check if the pos has changed, if not, delete the old pos and replace that with the new one. Keep repeating until the pos is changed. player.GetAll() will get a table of all players.