Jump to content

(solved) Is there a line of code to use to detect how bad the ping of a player is


Recommended Posts

I need a simple code to detect if a player's connection is bad (has yellow or red ping) because I want to make a mod which speeds up their actions and stuff to make it less frustrating for them. Can somebody please help me with that cause I can't find anything that makes sense in the klei files for such a thing

Edited by . . .
Link to comment
Share on other sites

I'm not sure if there is a command to get the value of the performance display. Though there is a command for finding out the player's ping.

TheNet:GetPing()

It returns a number value.

Edited by HarryPPP
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, HarryPPP said:

I'm not sure if there is a command to get the value of the performance display. Though there is a command for finding out the player's ping.


TheNet:GetPing()

It returns a number value.

Unfortunately, I searched through the DST scripts and I couldn't find any instance of it being used. Do you know how I could use it, if not that's fine, thanks for the helpĀ :D!

Link to comment
Share on other sites

In playerstatusscreen.lua you can find the code used for showing the client performance for determining whether they are red-green

Its probably netscore your looking for, looking through the other files you'll find it used in

  • widgets/redux/playerlist.lua
  • widgets/desync.lua
  • screens/playerstatusscreen.lua
Edited by IronHunter
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...