How reliable would a Daily Rewards system based on AccountAge be?

Hello everyone,

So recently I’ve been wondering if it would be reliable and good practice to utilize a player’s AccountAge to create a daily rewards system. A lot of daily reward systems are based on keeping track of a player’s last login date and then doing some arithmetic to figure out how long it has been since the player’s last login date. I was wondering, since AccountAge is a counter that returns how old a player’s account is, wouldn’t it be better to use AccountAge instead of time + arithmetic to create a daily rewards system?

An example would be to record the player’s AccountAge when they leave the game, and check if it the counter has went up the next time the player joins the game. Essentially, it’s using a property given by Roblox to keep track of when a player joins the game instead of creating your own way to keep track, if you know what I mean…

If you need clarification with what I mean, feel free to leave a question. Also, since I have never seen this being done before, there are probably flaws in this that I am not aware of.

Thank you.

2 Likes

If I’m not wrong, AccountAge only measures days, this means that this way you would not be able to do the timer taht is always here, also not sure but doesn’t AccountAge update at midnight? But otherwise I don’t have any idea of what there’s wrong with this

3 Likes

That’s exactly what I mean. You don’t need to have a timer anymore (which is a downside, thanks for telling me). Instead, it can be handled by AccountAge which measures days.

For this, I’m not sure myself. Also, I don’t know if it’s the Player’s local timezone or Roblox’s global default timezone (probably like California timezone if I’m guessing). But if it updates at the player’s midnight, this would make the daily reward system better since this is usually what you’d see in a game not on roblox, but current daily reward systems can refresh during the middle of the day or at random times, which wouldn’t be the best in my opinion.

2 Likes

ngl its easier to use tick() to get time passed from the last reward for example:

local day = 60*60*24 --Seconds*Minutes*Hours
if tick()>lasttick+day then
 --24 hours passed
end
1 Like

That isn’t what I’m asking for. What I’m asking for is whether its easier, efficient, and better overall to utilize AccountAge instead of performing arithmetic with time. What you’ve given me is an example of performing arithmetic with time.

Using account age method, people can get 2 daily rewards in 1 hour. If you are ok with that

1 Like

Using AccountAge for this purpose is never a good idea, when using AccountAge you would be getting the Exact number of Days the Player has Existed for, You would be looking at Hundred or Potentially Thousands of Days, It doesnt make it easier, Its actually missing components to help check whether it was on time, or was late. You can obviously do the if the next day then this, but you shouldn’t do that, if the Player did they, they could get more than one Reward at the same time which is never something you want.


I have never seen AccountAge used for Daily Rewards. It just isnt reliable.


Instead what you should be doing is keeping track of the exact time they joined and left using os.time() or os.date() for this purpose:

os.date("*t")  -- Local Time
os.date("!*t") -- UTC Time
---------------------------------------------------------------------------
os.time()      -- Time in Seconds from UNIX Epoch (UTC Time) (1/1/1970)

os library


So with this kind of system, you should be checking if the time is exactly One Day apart from the Other. This can be done by subtracting the time which the Players Current time, which you would Have to save Via DataStoreService to keep track of, and Determine if its greater than 86400 (60*60*24) or below to cancel the reward and or their streak, This is the best system as anytime within the Day, they can start their streak, and anytime in the day they can earn it, or lose it, its a much better system than having it a fixed system based on how fast their AccountAge will change.


@absentdenik
Just so you know, tick() is planned for Deprecation or Is already Deprecated, it is also slower than other methods now, so it isnt a recommended, or a reliable option anymore.

Edit:
I did a bit or research and yes, tick() is deprecated , you should be using os.time() instead.


2 Likes

Good point, it never occurred to me that could happen.

Thanks for this really detailed explanation lol, I’ll look more into it

1 Like