Attempt to index nil with waitforchild on a npc and this is a reward script here's my code
local Player = game.Players.LocalPlayer
local Leaderstat = Player:WaitForChild("leaderstats")
local Humanoid = script.Parent.Humanoid
function Dead()
Player.leaderstats.Cash.Value = Player.leaderstats.Cash.Value + 100
wait(0.1)
script:remove()
end
Humanoid.Died:connect(Dead)

2 comments
On which line does it occur?? And also, is this a local or server script?
a server script and on the leaderstat part