How do I find the LocalPlayer's ping?

What do you want to achieve?

I want to find the player’s ping. I’m thinking this might work with either a StarterPlayer script or a ServerScript, as the game will most likely be singleplayer. I’m relatively new to scripting, so I don’t know if this would be really easy or hard to make.
For reference, check out Arsenal. This game displays your ping, server location, and fps in the top right.

What solutions have you tried so far?

I’ve looked pretty far across the web for answers, but I’m not really getting much. I know it would be way easier to just add a note that they can hit ctrl+F7, but I really want to add in details that make this game different.

And that’s basically it. I want to find a player’s ping in ms and I’m not sure where to start. If anyone has any topics or links to direct me, that’d be great.

1 Like

You can run this in a localscript.

task.wait(2)
print(game.Players.LocalPlayer:GetNetworkPing() * 1000)

It might not work because I forgot if this works in the client or server.

2 Likes

Not exactly what you are asking for but in the case of you wanting to put this on a gui i think the server fps next to it would fit well, you can achieve this with

math.clamp( math.floor( 2/wait() ), 0, 60) 
2 Likes