I am trying to make a zombie game for me and my friends to play but I don't know how to make it so you gain cash for each kill. I want it to be different for each different zombie.
Info: The currency is "Cash" Here is also the leaderboard script:
print("Cash Leaderboard Loaded")
function onPlayerEntered(newPlayer)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
local cash = Instance.new("IntValue")
cash.Name = "Cash"
cash.Value = 50
cash.Parent = stats
stats.Parent = newPlayer
end
game.Players.ChildAdded:connect(onPlayerEntered)
Thank you to anyone that helps

1 comment
You need to keep track of who killed the zombie ie who attacked last then find this player and give them the cash