[PunRPC]
    private void Shoot()
	{
        if (currentWeapon.clipSize == 0 || isReloading)
            return;

		Vector3 direction = muzzle.transform.forward;

		currentWeapon.clipSize--;

		if (Physics.Raycast(muzzle.transform.position, direction, out RaycastHit hit, currentWeapon.range))
		{
			//GameObject clone = Instantiate(hitParticle, hit.point, Quaternion.LookRotation(hit.normal));
			//Destroy(clone, 2);

            GameObject objectHit = hit.transform.gameObject;
            var team = objectHit.GetComponent<Team>();

            if (team)
            {
                if (playerRoot.GetComponent<Team>().playerTeamIndex != objectHit.GetComponent<Team>().playerTeamIndex)
                {
                    if (objectHit.CompareTag("Entity"))
                    {
                        objectHit.GetComponent<PlayerStats>().Damage
                            (
                            currentWeapon.maxDamage - currentWeapon.maxDamage / Vector3.Distance(transform.position, objectHit.transform.position)
                            );
                    }
                    else if (objectHit.CompareTag("Destructable"))
                    {
                        objectHit.GetComponent<GeneratorStats>().Damage(currentWeapon.maxDamage);
                    }
                }
            }
		}
	}
string id => "70m";
DateTime createdAt => new DateTime ("2019-Aug-10 02:56:26 UTC");