--outside function
local exhaustion = {}
--inside function
local playerId = player:getId()
local currentTime = os.mtime()
if exhaustion[playerId] and exhaustion[playerId] > currentTime then
-- do nothing, or tell player they are exhausted
-- maybe teleport them to previous tile?
return false
end
exhaustion[playerId] = currentTime + 2000 -- 2000 milliseconds