Hello scripters! This is my first question soo yeah. My question is.. Is there a way to get the client's ping? I have seen this in games like Arsenal. I tried using this code:
local currentPing = tick() -- epoch time
while wait(1) do
currentPing = (currentPing()-tick())
print(currentPing)
end
but sadly it doesn't work. I even tried using ping meters. Most of them are giving me errors. Any help? Also, I want to make a GUI that can show the player their ping.]
Edit: I used this code:
while wait() do
local ping = (1/wait())
print("Your ping is "..ping)
end
and it was fairly better than 0 (no offense).
Please help!

4 comments
nope. it does not work. i printed the ping and it printed stuff around 0.9 when my ping is much much more than...0.9.
That's your ping in seconds. Usually ping is measured in milliseconds, so simply multiply that result you get by 1000 and you'll get a ping you're used to. Sometimes ping is also measured in half of the round trip instead of the full round trip, so in that case you could multiply it by 500 instead.
i accept this answer but can you get the exact amount? in the output, the ping is around 50. but my actual ping is like 30, 60, 90, 80, 10 etc.
by any chance can you test this out yourself? im using the performance stats to check the actual ping..