|
| 12 Jan 2014 07:21 PM |
| Is there any way to get the current time for the player? Can I get the time according to the time zone the player's computer is in? |
|
|
| Report Abuse |
|
|
|
| 12 Jan 2014 07:27 PM |
| I don't know how to do it but it is possible. Check out the game by BassWobble called clock. |
|
|
| Report Abuse |
|
|
robomax11
|
  |
| Joined: 07 Jul 2011 |
| Total Posts: 6828 |
|
|
| 12 Jan 2014 07:31 PM |
omg omg omg
block if u dont know how u shuldn't be in SH'ers
is called tick()
tick()
tick()
|
|
|
| Report Abuse |
|
|
|
| 12 Jan 2014 07:31 PM |
| I answered half of his question and I can help others with multiple other things so please stop the sass and think before you say. |
|
|
| Report Abuse |
|
|
|
| 12 Jan 2014 07:32 PM |
@robo if you cant read you shouldnt be in SH
He wants it according to the time zone they're in time zone time zone time zone
tick() doesnt do that. |
|
|
| Report Abuse |
|
|
|
| 12 Jan 2014 07:36 PM |
| Correct shredder, I've seen it done before, I just don't know how to do it :( |
|
|
| Report Abuse |
|
|
robomax11
|
  |
| Joined: 07 Jul 2011 |
| Total Posts: 6828 |
|
|
| 12 Jan 2014 07:36 PM |
ahhahahah void get out
i quote the wiki
"Returns the time in UNIX time, which is the number of seconds since the Unix epoch, January 1st, 1970. This time advances without the place running, network synchronization, or wait(). Using tick() in a LocalScript may result in a different number that if you were to use it in a Script because using it in a LocalScript will fetch the user's current time while using it in a Script will fetch the server's current time. tick() is very accurate. Because of its high accuracy, it can be used to measure the time a certain function takes to execute by calling it before and after an operation has been done, then finding the difference."
omg i was right
tl;dr version : local script using tick gets time zone time tick in script gets sererv's time (aka pacific) |
|
|
| Report Abuse |
|
|
|
| 12 Jan 2014 07:43 PM |
Excuse me, I believe that I am needed here.
tick() returns UNIX. This is the amount of seconds since the epoch on 1st of January, 1970.
You can use tick() in 2 ways:
1) On the server (Retrieves the server time) 2) On the client (Retrieves the client time).
To get the time, you need to do the following:
local secs=tick()%60 local mins=tick()%3600/60 local hours=tick()/3600%12 -- or %24, depending if you want 24 hour clock
To get a player's time, run that in a LocalScript in either Player.Backpack, Player.PlayerGui or Player.Character.
Keyboard not found. Press F1 to continue. |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Jan 2014 07:47 PM |
@Void
os and io libraries are set to nil in roblox.
Keyboard not found. Press F1 to continue. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 12 Jan 2014 07:50 PM |
| Thankyou Basswobble. I hope it wasn't too hard to find the post. Nice places by the way. |
|
|
| Report Abuse |
|
|
|
| 12 Jan 2014 07:50 PM |
| so it would be: print(hours:minutes:seconds) |
|
|
| Report Abuse |
|
|