public void CmdDealDamage(GameObject from, int damage) { TeamManager fromTeanManager = from.GetComponent <TeamManager>(); if (fromTeanManager != null) { if (scoreDisplayer != null) { if (fromTeanManager.GetTeam() != teamManager.GetTeam()) { scoreDisplayer.RpcAddKill(fromTeanManager.GetTeam()); } } } playerController.RpcDie(); }