I posted this not long time ago, and i received this script right here. I edited him a little bit for my use. But now, i have some questions about it. I'd like to create a UI with the amount of time before the reward. So i tried to send back the value of the PlayerData to get the time, but since she send me this in the output.
function: 16E5BAC4
--< Services
local PlayerService = game:GetService('Players')
local DataStoreService = game:GetService('DataStoreService')
--< Variables
local DailyRewards = DataStoreService:GetDataStore('dailyRewards')
local RewardTime = 24 -- One day
local RewardAmmount = 50 -- They get 50 cash each day
local SessionData = {}
--< Event
PlayerService.PlayerAdded:Connect(function(Player)
local ls = Instance.new('Folder')
ls.Name = 'leaderstats'
ls.Parent = Player
SessionData[Player] = {}
SessionData[Player]['Cash'] = 100
local Cash = Instance.new('IntValue', ls)
Cash.Name = 'Cash'
Cash.Value = SessionData[Player]['Cash']
local PlayerData = nil
pcall(function() -- No errors pls
PlayerData = DailyRewards:GetAsync('player_' .. Player.UserId)
end)
if PlayerData then
if ((os.time() - PlayerData) / (60 * 60)) >= RewardTime then
Cash.Value = PlayerData + RewardAmmount
DailyRewards:SetAsync(Player.UserId, os.time())
else
Cash.Value = PlayerData
end
else
DailyRewards:SetAsync(Player.UserId, os.time())
end
end)

3 comments
os.time()
dude its easy just put the vector7 in the script and let the time center run for a while !
Vector7? This is not exist (Vector2, Vector3)