"RealMoney" is the currency and is in the player not in leaderstats "Zombie" is the name of the zombie and I renamed the humanoid into Zombie The script works once, For example when the Zombie dies money is given but when it respawns and I kill it again nothing happens.
local Humanoid = game.Workspace.Zombie game:GetService('Players').PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) Zombie:WaitForChild("Zombie").Died:Connect(function() player.RealMoney.Value = player.RealMoney.Value + 1000 end) end) end)
You'd want to use workspace.ChildAdded so that when new zombies get added, and they die, the player gets money again Keep in mind that this will only work if the zombie gets added to workspace
workspace.ChildAdded:Connect(function(zombie) if zombie.Name == "Zombie" then zombie:WaitForChild("Zombie"),Died:Connect(function() player.RealMoney.Value = player.RealMoney.Value + 1000 end) end end)