"Zombie" is the zombies in the game which is in workspace. "RealMoney" is made when game starts so is in the player and isn't in leaderstats . "CoinBoost" is made by pets it's a variable saved of how much extra coins pets give you. This Script is for when the Zombie dies and money is given plus the value the coin boost has.
local Zombie = game.Workspace.Zombie
local char = script.Parent.Parent
local plr = game.Players:GetPlayerFromCharacter(char)
local RealMoney = plr:FindFirstChild("RealMoney")
local boost = plr:FindFirstChild("CoinBoost")
Zombie:WaitForChild("Zombie").Died:Connect(function()
plr.RealMoney.Value = plr.RealMoney.Value + 100 + boost.Value
end)

1 comment
.Humanoid.Died