Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 17 Jul 2015 05:23 PM |
local getPing = function() local tick1 = tick() local unnecessary = game.ReplicatedStorage.Ping:InvokeServer() local tick2 = tick() return tick2-tick1 end
it gets the first tick before running the remotefunction, and then gets the second when the first one returns. This just returns numbers like 12.8348573489654396
trying to learn to hack on windows is like trying to play football in a body cast |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2015 05:25 PM |
| ping is 12.83 milliseconds |
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 17 Jul 2015 05:26 PM |
that can't be right
because i also got this
Ping: 0.00011944770812988
trying to learn to hack on windows is like trying to play football in a body cast |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 Jul 2015 05:28 PM |
"that can't be right
because i also got this
Ping: 0.00011944770812988"
Which would be 0.00012 seconds or 0.12 milliseconds |
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 17 Jul 2015 05:30 PM |
no, because it came back in like 1 second
trying to learn to hack on windows is like trying to play football in a body cast |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2015 05:34 PM |
| Do it 10k times and get the average, or something. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 17 Jul 2015 05:51 PM |
| That's not their ping, sorry to disappoint. But it's close enough. |
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 17 Jul 2015 06:02 PM |
@eLunate
HOW 2 PING
trying to learn to hack on windows is like trying to play football in a body cast |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 17 Jul 2015 06:04 PM |
| You can't really, but you can probably get a more accurate result by using RemoteEvents instead and some tick + os.time client/server trickery. |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 17 Jul 2015 06:07 PM |
how would you get ping then? this interests me too
would you do something like this? excuse me if i'm terribly wrong, it's just a guess:
-- local script local plr = game.Players.LocalPlayer local remoteFunction = plr:WaitForChild(plr.Name.."'s Function")
while wait(3) do -- invoke the server every 3 seconds to return their ping local lastTick = tick() local ping = remoteFunction:InvokeServer(lastTick) print(ping) -- ???? end
-- server script
game.Players.PlayerAdded:connect(function(plr) local remoteFunction = Instance.new("RemoteFunction", plr) remoteFunction.Name = plr.Name.."'s Function"
function remoteFunction.OnServerInvoke(tick) local currentTick = tick() local ping = currentTick - tick return ping end end)
??? |
|
|
| Report Abuse |
|
|
NotAshley
|
  |
| Joined: 16 Jan 2014 |
| Total Posts: 14257 |
|
|
| 17 Jul 2015 06:24 PM |
| There should be a built in function for this |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 17 Jul 2015 06:31 PM |
muh skropt was wrong cos i used tick() on the server and then compared it with the clients tick()
whoops
-- local script local plr = game.Players.LocalPlayer local remoteFunction = plr:WaitForChild(plr.Name.."'s Function")
while wait(3) do -- invoke the server every 3 seconds to return their ping local lastTick = tick() remoteFunction:InvokeServer() local currentTick = tick() local ping = currentTick - lastTick print(ping) -- ???? end
-- server script
game.Players.PlayerAdded:connect(function(plr) local remoteFunction = Instance.new("RemoteFunction", plr) remoteFunction.Name = plr.Name.."'s Function"
function remoteFunction.OnServerInvoke(tick) return 'blah' end end)
and it looks like i did exactly the same thing as OP now
@not
ye good point |
|
|
| Report Abuse |
|
|