Esc Key code?
#1

I saw in a server that when a player is using the Esc button
Afk gets a 3D Text Label above her head
It is shown that it is written, for example
Afk For 17s.
And when the player leaves afk, the 3D Text Label is hiding.
Do you have the Esc key code?
Reply
#2

My guess would be that this 3D Text Label is being displayed and updated by a 1 second timer.
And using OnPlayerUpdate to detect if the player's game is being updated.
When a player presses ESC, the main menu is being displayed and the game doesn't receive or send any updates anymore.

You could use OnPlayerUpdate to continuously reset a variable and use the timer to increase it once every second.
In that timer, you could set a if-statement to check if the variable has been set to 2 or higher.
If so, OnPlayerUpdate is not resetting the variable anymore and thus, the player has pressed ESC and is afk (or browsing the map).
In this case, display the text label and update the time using the variable as the time he's been afk.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)