KAAK82Join Date: 2014-05-06 Post Count: 1166 |
I heard that it can help make a Daily Reward System, well, how can I use it then? the one who told me about this said it's hard, so am guessing I cant do print(os.time()) or anything similar... am looking into the Wiki and everywere I can about this, if ya got anything to say, tell me. |
|
smiley599Join Date: 2010-01-23 Post Count: 21869 |
> print(os.time())
14 05 016 167
how hard can it get:P |
|
smiley599Join Date: 2010-01-23 Post Count: 21869 |
there were no spaces either
i had to do that cuz its not allowed (phone number? idk) |
|
KAAK82Join Date: 2014-05-06 Post Count: 1166 |
hmmm... I though that u couldn't do that... well, how would I get the EXACT SAME Time? I'd rather my Timezone though (Middle, +0) but if it's more efficent or wat not to do their Time Zone then I'd like that too... cos I already have the Plan set up on how to give Rewards and tell the System if he's been Rewarded... |
|
KAAK82Join Date: 2014-05-06 Post Count: 1166 |
no1? |
|
vlekje513Join Date: 2010-12-28 Post Count: 9057 |
tick() in localscript then, but thats not trusted. |
|
KAAK82Join Date: 2014-05-06 Post Count: 1166 |
wich do u mean not Trusted? I hear guys say its os.time and others say tick... so wich is actually not Trusted? tick()? is it cos u can set the Date in ur Computer and it will follow? |
|
blox6137Join Date: 2008-11-23 Post Count: 1109 |
Actually, the os library is locked, so you couldn't use it anyway. |
|
KAAK82Join Date: 2014-05-06 Post Count: 1166 |
wat u mean 'cant use'? |
|
|
os = os or {}
os.time = tick
ROBLOX servers do not have synchronized times so even if you use tick() inside of a server script it still isn't reliable. You could use httpservice to get the actual time from a webpage or just use tick(). |
|
DurfungusJoin Date: 2009-02-07 Post Count: 15988 |
tick() gets this big old time from like 20 years ago, idk why they wouldnt all be synced
Currently have 46k R$ [HELP, DURFUNGUS IS SPREADING] Twitter - @Durfungus |
|
CasualistJoin Date: 2014-06-26 Post Count: 4443 |
Its very simple. Use tick() from a serverscript to get unix time. Google unix time. Then all you have to do is check what day they logged in on math.floor(tick()/(24*60*60))
and give rewards when math.floor(tick()/(24*60*60)) is bigger than the last stored day. |
|
KAAK82Join Date: 2014-05-06 Post Count: 1166 |
does that give u the day? the thing u gave... math.floor(lala(NO*NO*NO)) |
|
KAAK82Join Date: 2014-05-06 Post Count: 1166 |
I tried print(math.floor(tick()/(24*60*60))) and I tried that a few times, I waited like a few mins, I see the Number is still the same, so I know I can trust this, thnx, I can already make my thing... btw, some of yas keep saying 'Get the Date using http Service, y is it so important if u can already get a Result from just doing math.floor(tick()/(24*60*60))? |
|
|
os.time() returns the time to the nearest second (Since 1970) in GMT (Probably).
So, if math.floor(os.time()/(86400)) ~= prevDay then its a new day! |
|
|
DO NOT USE tick()!
You will get time reverting randomly, depending on where the server is located. |
|
KAAK82Join Date: 2014-05-06 Post Count: 1166 |
thnx, but were did u get 86,400? |
|
|
KAAK82Join Date: 2014-05-06 Post Count: 1166 |
so I see, Thnx, so am guessing GMT is Middle (near Ireland and Britain)? |
|
|
KAAK82Join Date: 2014-05-06 Post Count: 1166 |
Sweet! Just as I want it :D I might Reward people Daily in my GTA Game wen am at least Started :/ so sad that I made myself a promise, and I'll needa make 3 Islands, Smallest size 250x250 each, then making all those Vehicles, adding Sounds, Rotation Wheels, Adding Supsension, NPC's, Cops, NPC's driving Cars, NPC's Helping doing a Drive-By, NPC's riving while u shoot, making Missions with Sounds, Animations and more, OMG, am gonna have a sore Head if I keep thinking about how to do all this, and plus stop being lazy :'( ;'( |
|