Which services do I need to do a daily reward system?
You can use os.time()
local rewardTime = 24 -- one day local rewardAmmount = 50--they get 50 cash each day local dataStore = game:GetService("DataStoreService"):GetDataStore("dailyRewards") -- we need a leaderboard game:GetService("Players").PlayerAdded:Connect(function(player) local ls = Instance.new("Model") ls.Name = "leaderstats" ls.Parent = player local cash = Instance.new("NumberValue") cash.Name = "Cash" cash.Parent = ls local playerData = nil pcall(function() -- no errors pls playerData = dataStore:GetAsync("player_" .. player.UserId) end) if playerData then if ((os.time() - playerData) / (60 * 60)) >= rewardTime then cash.Value = playerData + rewardAmmount dataStore:SetAsync(player.UserId, os.time()) else cash.Value = playerData end else dataStore:SetAsync(player.UserId, os.time()) end end)
Note: It does not work in Studio unless API Services is enabled and cash does not save, to save, add a PlayerRemoving event.