So I am making something where a npc dies it gives everyone cash, I am having a problem where it won't even give out the cash, please help!!
Code:
local player = game.Players:GetPlayers()
script.Parent.Humanoid.Died:Connect(function()
for i,v in pairs(player) do
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + 500000
end
end)
Error: 02:36:36.236 - Workspace.Boss1.Script:5: attempt to index nil with 'Coins'
