I already have a savable leaderboard. Its all good.
Now, I am making a daily reward system. It is working, but it won't reward the player.
Cash is not working.
This is the cash part of my leaderboard
local cash = Instance.new("IntValue",stats) cash.Name = "Cash"
This is the daily reward script
local reward = possibleRewads[math.random(1,#possibleRewads)] game.ReplicatedStorage.ShowDailyReward:FireClient(player,hourWait,reward) local connection connection = game.ReplicatedStorage.ClaimReward.OnServerEvent:Connect(function(triggeringPlayer) if triggeringPlayer == player then print("Reward Claimed") player.leaderstats.cash.Value = player.leaderstats.cash.Value + reward DataStore:SetAsync(player.UserId.."-dailyReward",os.time()) connection:Disconnect() end end)
You wrote player.leaderstats.cash.Value
but you named it Cash
. If you inspect the output (F9), it should say something about that in the server output.
Also note that you need to disconnect the connection if the player leaves the game (in case they never claim the reward).