generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: How do you get a player's ping?

Previous Thread :: Next Thread 
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
17 Apr 2014 10:40 PM
Is it even possible with RBX lua? I glitched the leaderboard in Murder and saw that he had a ping value next to the players, probably for debugging. How would one do that? I only have experience with Lua.
-=Robo=-
Report Abuse
TheScriptAdventurer is not online. TheScriptAdventurer
Joined: 14 Oct 2013
Total Posts: 137
17 Apr 2014 10:43 PM
It is actually not difficult my friend! You can use an inbox-style system that resides in ReplicatedStorage. That is what I do :)
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
17 Apr 2014 10:44 PM
Could you explain further, with possibly an example? It'd send a message from the client to the server, I think...? Is that what it'd do?
I'm not 100% on this lol
-=Robo=-
Report Abuse
tinarg is not online. tinarg
Joined: 18 Jun 2010
Total Posts: 4925
17 Apr 2014 10:46 PM
...Ping?
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
17 Apr 2014 10:47 PM
Ping is the amount of milliseconds it takes a packet of information to reach it's destination and return.
-=Robo=-
Report Abuse
tinarg is not online. tinarg
Joined: 18 Jun 2010
Total Posts: 4925
17 Apr 2014 10:48 PM
Ah.
Report Abuse
TheScriptAdventurer is not online. TheScriptAdventurer
Joined: 14 Oct 2013
Total Posts: 137
17 Apr 2014 10:52 PM
sorry; should've elaborated further. Ok, so you have an inbox object, in ReplicatedStorage, which could be of any object that is not a service I think. Then, when you want to request something of the player, you would add a stringValue object, with a text value that specifies the service that I want performed; the name of the function (my system is a little more complicated, but lets stick with this!). Then, I put a return value object of stringvalue type inside the request object, which I then read; it would basically be an acknowledgement. Then I delete the request object. The local side would serve this request by having a ChildAdded event connection to the inbox. The server side would basically poll the request object for a new child (if it wants to be a blocking one) or make a ChildAdded connection (to be asynchronous).
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
17 Apr 2014 10:53 PM
Tick method?
Report Abuse
TheScriptAdventurer is not online. TheScriptAdventurer
Joined: 14 Oct 2013
Total Posts: 137
17 Apr 2014 10:58 PM
what do you mean?
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
17 Apr 2014 11:11 PM
before = tick()
--Send thai stuff
after = tick()

time_it_took = (after-before)

print(time_it_took)--Will go to the ten-centrillionth(Two places after hundred-trillionth[16 digets])
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
17 Apr 2014 11:14 PM
would that actually work? o.o
i thought if you set a variable to tick then it would just get the real time for that on both variables
-=Robo=-
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
17 Apr 2014 11:21 PM
Yeah it would work(: Pretty neat huh? The tick method is like the time in seconds from January 1st, 1970 to now So if you put that time before an event then after and subtract the two it acts as a timer.. an extremely accurate timer xD For more info; http://wiki.roblox.com/index.php?title=Tick()#tick.28.29
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
17 Apr 2014 11:28 PM
So how would I round the number returned from your method, I'm assuming I'd use one of the math rounding functions or something?
There's two for rounding up and down, though.
-=Robo=-
Report Abuse
blue30097 is not online. blue30097
Joined: 25 Feb 2011
Total Posts: 1864
17 Apr 2014 11:34 PM
DDOSER!
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
17 Apr 2014 11:35 PM
hot
Anyone notice how ROBLOX undergoes maintenance every night?
They must have a lot of stress going on the servers to have maintenance this often.
-=Robo=-
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
17 Apr 2014 11:53 PM
The two methods of rounding nubers with decimals are math.ceil and math.floor, as you could've probable connected, math.ceil(like ceiling?) is to round up, and math,floor(like floor?) is to round down.
Report Abuse
robotmega is not online. robotmega
Joined: 16 May 2009
Total Posts: 14084
18 Apr 2014 12:02 AM
math.floor(num+.5)
Report Abuse
lupine is not online. lupine
Joined: 24 Jun 2008
Total Posts: 3561
18 Apr 2014 12:06 AM
No. That's a very bad rounding method.

Might I forward all of you gentlemen to this thread:
http://www.roblox.com/Forum/ShowPost.aspx?PostID=115050359
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image