vat21s
|
  |
| Joined: 07 Jun 2010 |
| Total Posts: 2508 |
|
|
| 24 Mar 2015 09:51 PM |
| What would be the best way to get a non changing time scale. Such as GMT+0 or EST,PST ect? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 24 Mar 2015 10:03 PM |
| Well considering Roblox is PST, it might be better to use PST although either that or GMT (IMO). |
|
|
| Report Abuse |
|
|
vat21s
|
  |
| Joined: 07 Jun 2010 |
| Total Posts: 2508 |
|
|
| 24 Mar 2015 10:28 PM |
I found a good method, I'll post it here just incase someone from the future needs something like this.
Step 1) Enable HTTPApi Step 2) Make a new IntValue Step 3) Place the following in a script inside the IntValue
local TimeServer = "http://www.timeapi.org/utc/now?%25Q" local CurrentTime = Game:GetService("HttpService"):GetAsync(TimeServer, true) local TimeGame = tick(); script.Parent.Value = TimeGame-CurrentTime
Step 4) When you want to check how much real time has passed, Use tick()-PathToIntValueHere |
|
|
| Report Abuse |
|
|
|
| 24 Mar 2015 11:16 PM |
| Using os.time() should get the current UTC time in seconds (since January 1970) on Roblox servers, if I remember correctly. Then you won't have to use all this HTTP mumbo jumbo. |
|
|
| Report Abuse |
|
|
Seranok
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 11083 |
|
|
| 25 Mar 2015 02:53 AM |
| Yes, os.time() was made explicitly for this purpose. It's guaranteed to accurate within a few seconds. |
|
|
| Report Abuse |
|
|
|
| 25 Mar 2015 02:54 AM |
and guaranteed to be a pain in the ass to make readable
just use someone elses function for it
they usually involve like 3 loops 3 tables and such
elunate has one, lots of modules do too if u need that |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 25 Mar 2015 02:59 AM |
preview. c9. io/lunate/skyewashere/Time.lua |
|
|
| Report Abuse |
|
|
|
| 25 Mar 2015 07:08 AM |
| http://www.roblox.com/Realtime--item?id=228079226 |
|
|
| Report Abuse |
|
|