The definition for tick() on the wiki site says this:
numbertick()
Returns how much time has elapsed since the UNIX epoch, on the current local session’s computer.
The UNIX epoch is represented by the date January 1st, 1970.
By “local sessions computer”, does that mean if I store the current tick() and the player changes their date and time to lets say a day more than it currently is, if I were to reward something every day, could they just constantly change their time and get rewards?
Yes. The Client can change their system time to change what tick() will return.
But a thing here is: Why would you let the client determine whether or not they should get rewarded something everyday? It’s pretty much routine to never ever trust the client.
You’re much better off having the server determine whether or not the player is worthing of an award using os.time(). Which returns the time since the Unix Epoch in UTC Time, as opposed to a local system’s time.
Again, It was just an example to make sure I dont use it for anything too important. I was trying to find a way to get the players local timezone w/o having to use os.time() cause I dont know how to get it from that.
Thats the reason I created the topic. If someone changes their devices time, It will take it as they client is telling the truth, we simply cannot trust the client with anything. os.time() is the same always and cannot be changed.
Like the client. tick() on the server will change depending on where the server’s location is.
For simple things like timers, aka things that will only run during the duration of that server. tick() is fine to use on the server then. But for things like giving out rewards. Using os.time() is pretty much a must, as it always returns the same time-zone: UTC.