How to use Datastore2 to save Unknown values

Hello, as of now I only know how to use Datastore2 to save values that exist in game such as (Bools, Ints…) but when it comes to values such as saving if a player has already keyed a Twitter code or saving the time the player has until the next daily reward. How am I suppose to go about doing these?

1 Like

You can save something as true or false
So like

--DataStore2 script

local Claimed = false

--Player keys in twitter code script

If not Claimed then
-- Give reward
--Tell player code already redeemed

You can use os.time() for this.

Could you elaborate further on os.time? I am not really sure with it.

Here is the api about os

So basically, os.time() returns the number of seconds since 1st January, 1970, 00:00:00

1 Like