Hey there I'm working on a basic zombie defense game and I want to make it to when a zombie dies every player in the game gains money. I already have leaderstats and a currency set up I just don't know how to add x amount of currency to everyone's balance when a zombie dies.
If your curious why everyone and not the person who killed the zombie
I'm doing everyone gets money when a zombie dies because the bullets are made of parts so its difficult to give the player who killed the zombie the money.

3 comments
hmm I'm still having issues I had to switch some things up because of errors I had to change the GetDescendants cause stuido didint like that. im getting error on line 10 about trying to intex Nil with WaitForChild but I dont see the issue. the code hassint worked though this is what I got --> local Zombie = script.Parent:WaitForChild("Zombie") Zombie.Died:connect(function() local Players = ga
Instead of :GetDescendants use :GetPlayers() and do :FindFirstChild("Currencyname",true).Value += amountofcurrency
hmm I dont think its possible because you have to find a localplayer to find leaderstats. thank you for trying to help its very much appreciated! I have a ghetto solution in mind. I hope your havin a great day, night :)