Skip to content
M2O Scripting APIScripting reference
Global objectServer APIGenerated

Weapon

const Weapon: object

Defined in: server/api.d.ts:2438

Per-weapon damage balance. A multiplier scales a weapon’s native power curve on every client, so bullets, blasts and melee swings with that weapon id deal that much more or less.

getBaseDamage(weaponId): WeaponBaseDamage | null

Returns the retail power curve of a bullet or blast weapon: power at 0 m and at two falloff distances, then the three distances in metres.

number

Weapon id to look up.

WeaponBaseDamage | null

The curve, or null for melee and unknown ids.

getDamageMultiplier(weaponId): number

Reports the damage scale currently applied to a weapon.

number

Weapon id to query.

number

The multiplier, 1 when the weapon is at retail damage.

resetDamage(weaponId?): void

Restores a weapon, or all weapons, to retail damage.

number

Weapon id to restore; omit to restore every weapon.

void

setDamageMultiplier(weaponId, factor): void

Scales how much damage a weapon deals. Takes effect on every client within a moment and applies to bullets, blasts and melee swings; shots already in flight keep the previous value. Throws for a weapon without adjustable damage or a factor outside 0..100.

number

Weapon id (weapons.tbl row) to scale.

number

Scale applied to the weapon’s retail damage; 1 is retail, 0 disarms it, up to 100.

void