# Add Weapon To Unit

Grammar — Add weapon to unit using turret turret
FlagsNative | Action

Adds the specified weapon to the specified unit using the specified turret.

# Arguments

  • unit — Unit
  • string<gamelink::Weapon> — Weapon
  • string<gamelink::Turret> — Turret

Returns — void

native void UnitWeaponAdd(
	unit inUnit,
	string inWeapon,
	string inTurret,
);

Category: Unit / Weapons

# Examples

mods/heroesbrawlmods/arenamodemods/gardenarena.stormmodbase.stormdata/LibAMGT.galaxy:360

    UnitBehaviorAdd(lv_plantTerror, "VictorySequenceImmunetoStasisBehavior", lv_plantTerror, 1);
    UnitBehaviorAdd(lv_plantTerror, "HallOfStormsKnockbackImmunity", lv_plantTerror, 1);
    UnitWeaponAdd(lv_plantTerror, "VehiclePlantHorrorVictoryWeapon", null);
    UnitWeaponRemove(lv_plantTerror, "VehiclePlantHorror");
    libNtve_gf_MakeUnitInvulnerable(lv_plantTerror, true);

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:21117

    if ((UnitGetType(EventUnit()) == "MutaliskBroodlord")) {
        UnitWeaponRemove(EventUnit(), "GlaiveWurm");
        UnitWeaponAdd(EventUnit(), "CoopGlaiveWurm", null);
        return true;
    }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:26799

        UnitWeaponRemove(EventUnit(), "HunterKillerMelee");
        UnitWeaponRemove(EventUnit(), "HunterKiller");
        UnitWeaponAdd(EventUnit(), "ZagaraHunterKillerMelee", null);
        UnitWeaponAdd(EventUnit(), "ZagaraHunterKiller", null);
        return true;

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:26800

        UnitWeaponRemove(EventUnit(), "HunterKiller");
        UnitWeaponAdd(EventUnit(), "ZagaraHunterKillerMelee", null);
        UnitWeaponAdd(EventUnit(), "ZagaraHunterKiller", null);
        return true;
    }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:26807

        UnitWeaponRemove(EventUnit(), "AcidSaliva");
        UnitWeaponRemove(EventUnit(), "RoachMelee");
        UnitWeaponAdd(EventUnit(), "ZagaraAcidSaliva", null);
        UnitWeaponAdd(EventUnit(), "ZagaraRoachMelee", null);
        return true;

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:26808

        UnitWeaponRemove(EventUnit(), "RoachMelee");
        UnitWeaponAdd(EventUnit(), "ZagaraAcidSaliva", null);
        UnitWeaponAdd(EventUnit(), "ZagaraRoachMelee", null);
        return true;
    }