# Remove Weapon From Unit

Grammar — Remove weapon from unit
FlagsNative | Action

Removes the specified weapon from the specified unit.

# Arguments

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

Returns — void

native void UnitWeaponRemove(unit inUnit, string inWeapon);

Category: Unit / Weapons

# Examples

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

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

mods/novastoryassets.sc2modbase3.sc2maps/maps/campaign/nova/nova09.sc2map/MapScript.galaxy:1433

    gv_s2_Davis = UnitFromId(530);
    UnitBehaviorAdd(gv_s2_Davis, "Benign", gv_s2_Davis, 1);
    UnitWeaponRemove(gv_s2_Davis, "OfficersPistol");
    UnitSetPropertyFixed(UnitFromId(605109900), c_unitPropLife, 30.0);
    UnitSetPropertyFixed(UnitFromId(641606793), c_unitPropLife, 17.0);

mods/novastoryassets.sc2mod/base3.sc2maps/maps/campaign/nova/nova09.sc2mapMapScript.galaxy:1433

    gv_s2_Davis = UnitFromId(530);
    UnitBehaviorAdd(gv_s2_Davis, "Benign", gv_s2_Davis, 1);
    UnitWeaponRemove(gv_s2_Davis, "OfficersPistol");
    UnitSetPropertyFixed(UnitFromId(605109900), c_unitPropLife, 30.0);
    UnitSetPropertyFixed(UnitFromId(641606793), c_unitPropLife, 17.0);

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


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

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


    if ((UnitGetType(EventUnit()) == "HunterKiller")) {
        UnitWeaponRemove(EventUnit(), "HunterKillerMelee");
        UnitWeaponRemove(EventUnit(), "HunterKiller");
        UnitWeaponAdd(EventUnit(), "ZagaraHunterKillerMelee", null);

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

    if ((UnitGetType(EventUnit()) == "HunterKiller")) {
        UnitWeaponRemove(EventUnit(), "HunterKillerMelee");
        UnitWeaponRemove(EventUnit(), "HunterKiller");
        UnitWeaponAdd(EventUnit(), "ZagaraHunterKillerMelee", null);
        UnitWeaponAdd(EventUnit(), "ZagaraHunterKiller", null);

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


    if ((UnitGetType(EventUnit()) == "Roach")) {
        UnitWeaponRemove(EventUnit(), "AcidSaliva");
        UnitWeaponRemove(EventUnit(), "RoachMelee");
        UnitWeaponAdd(EventUnit(), "ZagaraAcidSaliva", null);

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

    if ((UnitGetType(EventUnit()) == "Roach")) {
        UnitWeaponRemove(EventUnit(), "AcidSaliva");
        UnitWeaponRemove(EventUnit(), "RoachMelee");
        UnitWeaponAdd(EventUnit(), "ZagaraAcidSaliva", null);
        UnitWeaponAdd(EventUnit(), "ZagaraRoachMelee", null);