// Will reward the Player with the NetworkInstanceID equal to <shooterID> that killed this Zombie. private void RewardPlayer(NetworkInstanceId shooterID) { foreach (GameObject player in GameObject.FindGameObjectsWithTag("Player")) { NetworkUser networkUser = player.GetComponent <NetworkUser>(); // If we found the Player with <shooterID>, then reward him. if (networkUser.netId == shooterID) { if (currentHealth <= 0f) { // If he killed us, add to his kills and give him the <deadReward>. networkUser.CmdUpdateKills(); networkUser.CmdUpdateCurrency(deathReward, false, false); } else { // If he damaged us, give him the <damageReward>. networkUser.CmdUpdateCurrency(damageReward, false, false); } } } }