I’m looking for a way in the gamemode Lua to detect when a player has stood still (not moving around) for more than 5 (or, n) consecutive seconds, and do a thing when it happens. I’m figuring it’s probably going to involve a hook of some kind. I just don’t know which one(s) would accomplish this.
I figured it might work something like defining a Timer for each player, set to a delay of n seconds, and then hook into a PlayerMovement event that would then reset that player’s timer when detected. If they don’t move, the event doesn’t fire, and the timer elapses to its delay and kicks off the commands I want to perform.
I was pretty surprised when I found no such event in any documentation. I’m hopeful that you guys might have an idea.
Thank you in advance!