Commit efbc533d authored by Tommy Ang's avatar Tommy Ang 🤣

Add tps metrics to tab

parent fd1ca76e
......@@ -1158,23 +1158,30 @@ on join:
add 1 to {re.%player%.current.hour}
set {re.%player%.current.minute} to 0
set {_ping} to player's ping
set {_tps} to tps from last 1 minute
loop all players:
set tab score of player to {_ping} for loop-player
if {_ping} is less than 101:
set {_ping} to "&a%{_ping}%"
if {_ping} is more than 299:
else if {_ping} is more than 299:
set {_ping} to "&c%{_ping}%"
else:
set {_ping} to "&e%{_ping}%"
if {_tps} is less than 15:
set {_tps} to "&c%{_tps}%"
else if {_tps} is more than 18:
set {_tps} to "&a%{_tps}%"
else:
set {_tps} to "&e%{_tps}%"
set {_player} to size of all players
set {_max} to max players count
player.setPlayerListHeader("&6You are now playing &lRammyCraft&r&6!%nl%&aOnline players: %{_player}%/%{_max}%")
if {re.%player%.current.hour} is more than 0:
player.setPlayerListFooter("Current Session: %{re.%player%.current.hour}% hour(s) | Ping : %{_ping}%")
player.setPlayerListFooter("Current Session: %{re.%player%.current.hour}% hour(s) | Ping : %{_ping}% &f| TPS : %{_tps}%")
else if {re.%player%.current.minute} is more than 0:
player.setPlayerListFooter("Current Session: %{re.%player%.current.minute}% minute(s) | Ping : %{_ping}%")
player.setPlayerListFooter("Current Session: %{re.%player%.current.minute}% minute(s) | Ping : %{_ping}% &f| TPS : %{_tps}%")
else if {re.%player%.current.second} is more than 0:
player.setPlayerListFooter("Current Session: %{re.%player%.current.second}% second(s) | Ping : %{_ping}%")
player.setPlayerListFooter("Current Session: %{re.%player%.current.second}% second(s) | Ping : %{_ping}% &f| TPS : %{_tps}%")
on quit:
clear {re.%player%.current.hour}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment