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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 4925 |
|
| |
|
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
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 4925 |
|
| |
|
|
| 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
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
| |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 25 Feb 2011 |
| Total Posts: 1864 |
|
| |
|
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
|
  |
| 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
|
  |
| Joined: 16 May 2009 |
| Total Posts: 14084 |
|
| |
|
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 |
|
|