# Add Weapon To Unit
Grammar — Add weapon to unit using turret turret
Flags —Native
|Action
Adds the specified weapon to the specified unit using the specified turret.
# Arguments
unit
— Unitstring
<gamelink::Weapon> — Weaponstring
<gamelink::Turret> — Turret
Returns — void
native void UnitWeaponAdd(
unit inUnit,
string inWeapon,
string inTurret,
);
# Related
Category: Unit / Weapons
- Remove Weapon From Unit —
void
— UnitWeaponRemove - Add Weapon To Unit —
void
— UnitWeaponAdd - Number Of Weapons On Unit —
int
— UnitWeaponCount - Unit Weapon —
string
<gamelink::Weapon> — UnitWeaponGet - Weapon Is Enabled —
bool
— UnitWeaponIsEnabled - Weapon Target Check —
bool
— UnitWeaponCheck - Weapon Cooldown —
fixed
— UnitWeaponPeriod - Weapon Range —
fixed
— UnitWeaponRange - Weapon Cooldown Remaining —
fixed
— UnitWeaponPeriodRemaining - Add Ammo To Magazine —
void
— UnitMagazineArm - Last Created Magazine Ammo Unit —
unit
— UnitMagazineLastCreated - Last Created Magazine Ammo Units —
unitgroup
— UnitMagazineLastCreatedGroup - Magazine Count Of Unit —
int
— UnitMagazineCount - Magazine Owner Of Unit —
unit
— UnitGetMagazine - Unit Can Attack Unit Old —
bool
— libNtve_gf_UnitCanAttackUnit - Unit Can Attack Unit Type —
bool
— UnitCanAttackTarget - Unit In Range And Able To Attack Target —
bool
— UnitInRangeAndAbleToAttackTarget - Weapon Damage —
fixed
— UnitWeaponDamage - Weapon Speed Multiplier —
fixed
— UnitWeaponSpeedMultiplier - Set Weapon Cooldown Remaining —
void
— UnitWeaponSetPeriodRemaining
# Examples
mods/heroesbrawlmods/arenamodemods/gardenarena.stormmod — base.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.sc2mod — base.sc2data/LibCOMI.galaxy:21117
if ((UnitGetType(EventUnit()) == "MutaliskBroodlord")) {
UnitWeaponRemove(EventUnit(), "GlaiveWurm");
UnitWeaponAdd(EventUnit(), "CoopGlaiveWurm", null);
return true;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:26799
UnitWeaponRemove(EventUnit(), "HunterKillerMelee");
UnitWeaponRemove(EventUnit(), "HunterKiller");
UnitWeaponAdd(EventUnit(), "ZagaraHunterKillerMelee", null);
UnitWeaponAdd(EventUnit(), "ZagaraHunterKiller", null);
return true;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:26800
UnitWeaponRemove(EventUnit(), "HunterKiller");
UnitWeaponAdd(EventUnit(), "ZagaraHunterKillerMelee", null);
UnitWeaponAdd(EventUnit(), "ZagaraHunterKiller", null);
return true;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:26807
UnitWeaponRemove(EventUnit(), "AcidSaliva");
UnitWeaponRemove(EventUnit(), "RoachMelee");
UnitWeaponAdd(EventUnit(), "ZagaraAcidSaliva", null);
UnitWeaponAdd(EventUnit(), "ZagaraRoachMelee", null);
return true;
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:26808
UnitWeaponRemove(EventUnit(), "RoachMelee");
UnitWeaponAdd(EventUnit(), "ZagaraAcidSaliva", null);
UnitWeaponAdd(EventUnit(), "ZagaraRoachMelee", null);
return true;
}