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)

2 comments
How is player (not triggeringPlayer since that's given in the Remote) defined in the second script?
Thats it. its triggeringPlayer == player