I am making a script that gives everybody "cash" (leaderstats name) if this zombie npc dies. My current code doesn't work. If you'd like a look, here it is. Thank you in advance.
local Humanoid local Leaderstats = workspace:FindfirstChild("leaderstats")
if Humanoid.Health <2 then Leaderstats.Cash.Value = Leaderstats.Cash.Value +2 end
local Humanoid = (the humanoid) function Died() for i,Player in pairs(game.Players:GetChildren()) do Player.leaderstats.currencyname.Value = Player.leaderstats.currencyname.Value + 2 end end Humanoid.Died:Connect(Died)