How to make a leaderboard with other player's ping?

hey guys, how would I go about making a ping leaderboard like this?
I was thinking of using some function of some sort? maybe remotes or bindables, but idk if that would be too heavy

I’ve seen other’s do it, and I was wondering if I could too. if anybody has any ideas, please share them! thanks :happy1:

1 Like

https://create.roblox.com/docs/reference/engine/classes/Player#GetNetworkPing

1 Like

how would I pass that to other clients tho?

You would have to send it via remote event

would it be too expensive tho? I fetch the player’s ping with :GetNetworkPing(), then I :FireAllClients()

As long as you arent sending it every frame you dont need to worry. Consider sending every 5 or so seconds.

Yes. Or you could store the average of the player’s ping on the server and send it to the clients at the end of a match.

ooh what if I pair it up with task.defer()? it would send it at every convenient frame right?

1 Like

You should not send data every frame that isn’t fundamental to gameplay. Im not familiar with :GetNetworkPing() so im not sure if it is client or server sided.

If :GetNetworkPing() is server sided:

  • make a loop that runs every 5 seconds
  • In the loop, fetch all players network ping and then :FireAllClients() with the fetched data

If :getNetworkPing() is client sided:

  • Every 5 seconds on the client, Send the ping to the server
  • When server recieves the update, update a table which contains the ping for each player
  • Every 5 seconds on the server, send the table using :FireAllClients()
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.