public void Cmd_ApplyDamage(float points) { npcHP -= points; if (npcHP <= 0) { if (isLocalPlayer || !isLocalPlayer) { dead = true; killCount.value += 1; Explode.GetComponent <ParticleSystem>().Play(); hideThis.transform.localScale = Vector3.zero; foreach (Behaviour childCompnent in gameObject.GetComponentsInChildren <Behaviour>()) { if (GetComponent <Animator>()) { gameObject.GetComponent <Animator>().enabled = true; } childCompnent.enabled = false; } es.Cmd_EnemyEliminated(); StartCoroutine(removeFromNetwork()); Destroy(gameObject, 3); } } }