1. Oxide for Rust Legacy has been discontinued and is no longer supported. No updates or additions will be made, and Rust Legacy-specific plugin submissions will no longer be accepted. We recommend upgrading to the latest version of Rust as able.
    Dismiss Notice
  1. S1LV4

    S1LV4 Naked Wanderer

    How to set a distance limit for the bow?
    being the standard limit of the bow is 1000 and I want to put in 60.

    Sorry for my English. I do not speak English that much.
     
  2. mcnovinho08

    mcnovinho08 Wood Hoarder Plugin Developer

    Code (Text):
            private void OnKilled(TakeDamage takedamage, DamageEvent damage)
            {
                var distance = Math.Floor(Vector3.Distance(damage.attacker.id.transform.position, damage.victim.id.transform.position));
               
                if (distace > 50) return CancelDamage(damage);
            }
           
            DamageEvent CancelDamage(DamageEvent damage) {
                damage.amount = 0;
                damage.status = LifeStatus.IsAlive;
                return damage;
            }
     
  3. mcnovinho08

    mcnovinho08 Wood Hoarder Plugin Developer