|
| 24 Dec 2014 01:56 PM |
| How would you get the number of days passed since a player last joined? Ex: If someone plays your game, then a week later they play again, I want to get the number 7, or if they played then played 3 days later, I want to get the number 3. |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 24 Dec 2014 02:03 PM |
| I thought you had like a 5 page thread asking about this already |
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Dec 2014 02:16 PM |
| I did, that was about a login bonus, which works fine now, but I'm still not sure how to get the number of days since they last joined :P. |
|
|
| Report Abuse |
|
|
Unclear
|
  |
| Joined: 27 Aug 2011 |
| Total Posts: 17060 |
|
|
| 24 Dec 2014 02:20 PM |
| Use os.time() and a form of datastore. Subtract, and convert the difference (which is in seconds) to days. |
|
|
| Report Abuse |
|
|
|
| 24 Dec 2014 11:07 PM |
| Ok thanks. What is the specific formula for that? |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 24 Dec 2014 11:32 PM |
60 seconds = 1 minute 60 minutes = 1 hour 24 hours = 1 day 7 days = 1 week
so.. os.time() / 60 / 60 / 24 / 7 = days |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
| |
|
|
| 25 Dec 2014 12:17 AM |
when the leave the game save os.time When they join lastjoin - os.time You can find the convertion of seconds to days,hours,minutes on the web
|
|
|
| Report Abuse |
|
|
| |
|