public void TakeDamage(int damageAmount) { if (!isServer || curretHealth <= 0) { return; } curretHealth -= damageAmount; RpcSetHealthUI(); if (curretHealth <= 0) { curretHealth = 0; RpcDied(); if (DeatMatchManager.RemoveTankAndChekWinner(this)) { TankHealth tankWinner = DeatMatchManager.GetWinner(); tankWinner.RpcWon(); Invoke("BackToLobbyManager", 5); } return; } }