fallout68
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 2249 |
|
|
| 11 Oct 2013 09:38 PM |
| tick() is one of the functions I still have no idea how to work, any help? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 11 Oct 2013 09:40 PM |
| tick just returns the amount of seconds since Jan. 1 19 something something. |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2013 09:40 PM |
tick() is almost never used to tell the time. Instead, people usually use it to tell very accurate time, or time over servers. For example: - Banning a player for 10 minutes. You would save tick + something to their data persistence that says when they can play again, and use tick() to check its time to stop kicking them whenever they join. - Checking how long a function takes: t = tick() print("Hi") t2 = tick() print("That took "..t2 - t.." seconds")
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
fallout68
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 2249 |
|
|
| 11 Oct 2013 09:44 PM |
| Erm, whats a better way to tell time then? |
|
|
| Report Abuse |
|
|
fallout68
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 2249 |
|
|
| 11 Oct 2013 09:45 PM |
For ONE time zone, not the client time zone.
EST, PST, and CST would be good. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 11 Oct 2013 09:46 PM |
You just get the amount of hours it offsets by from PST.
so
tick() * hours * (60 * 60)
Or if you are in a local script, it will just get your computer's tick() |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2013 09:46 PM |
Um... well, tick(). And math. It's just not a very common use of it. You would have to use it from a server-side Script though, if you want to stick to one timezone.
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2013 09:46 PM |
@cntkillme onoe you ninjad me |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
fallout68
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 2249 |
|
|
| 11 Oct 2013 09:54 PM |
| What cnt? I didn't get that at all.... |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 11 Oct 2013 10:01 PM |
| tick() in a server-sided script gives you Roblox's timezone, which is PST. |
|
|
| Report Abuse |
|
|
fallout68
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 2249 |
|
|
| 11 Oct 2013 10:07 PM |
| So what would the code be? |
|
|
| Report Abuse |
|
|
fallout68
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 2249 |
|
|
| 11 Oct 2013 10:08 PM |
| I should mention that this goes into a GUI. As of now, it just goes tick() and seconds. But there are ALOT of seconds since whatever the date is. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 11 Oct 2013 10:12 PM |
A LOT*
What is the problem...? |
|
|
| Report Abuse |
|
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
|
| 11 Oct 2013 10:57 PM |
This is what Tick is used for(Or how I mostly use it :P)
a = tick() --Code b = tick() print("It took:"..a-b)
|
|
|
| Report Abuse |
|
|