ServerScriptService.Leaderboard:17: attempt to index local 'player' (a number value)
local datastore = game:GetService("DataStoreService")
local ds1 = datastore:GetDataStore("CashSaveSystem")
game.Players.PlayerAdded:Connect(function(player)
local folder = Instance.new("Folder",player)
folder.Name = "leaderstats"
local cash = Instance.new("IntValue",folder)
cash.Name = "Cash"
cash.Value = ds1:GetAsync(player.UserId) or 0
ds1:SetAsync(player.UserId, cash.Value)
cash.Changed:Connect(function()
ds1:SetAsync(player.UserId, cash.Value)
end)
game.ServerStorage.Give.Event:Connect(function(player,Amount)
if player.Name == player.Name then
cash.Value = cash.Value + Amount
end
end)
end)
Filtering Enabled on
Script in ServerScriptService
BindableEvent in ServerStorage
BindableEvent rename to Give
I do it a lots of time but it not work.
I script 2 script
1.leaderboard 2.kill for money script
It not give me the Cash when I kill NPC.
I open output and click the only error one.
and it go to the box up there.
Please help.

2 comments
Thank, it work but there is a second error but I will not delete this
https://scriptinghelpers.org/questions/65133/error-creator-is-not-a-valid-member-of-humanoid