π« Weapon
info
Weapons are fully customizable, all pieces of the weapon can be changed with immense possibility of creation
info
Please take a look at our Default's Weapon package with all built-in Weapons already properly configured and ready to use: https://github.com/nanos-world/nanos-world-weapons.
Usageβ
-- Spawning an AK47
local new_weapon = Weapon(Vector(-900, 185, 215), Rotator(0, 90, 90), "nanos-world::SK_AK47", CollisionType.Normal, true)
-- Configures Weapon Base Settings
new_weapon:SetAmmoSettings(30, 1000)
new_weapon:SetDamage(30)
new_weapon:SetSpread(30)
new_weapon:SetRecoil(0.25)
new_weapon:SetBulletSettings(1, 20000, 20000, Color(100, 58, 0))
new_weapon:SetCadence(0.1)
new_weapon:SetWallbangSettings(50, 0.75)
-- Configures how the Character Grabs and Aims the Weapon
new_weapon:SetHandlingMode(HandlingMode.DoubleHandedWeapon)
new_weapon:SetSightTransform(Vector(0, 0, -14.85), Rotator(-1, 0, 0))
new_weapon:SetLeftHandTransform(Vector(26, 0, 8.5), Rotator(0, 60, 90))
new_weapon:SetRightHandOffset(Vector(-10, 0, 0))
-- Configures Weapon Particles
new_weapon:SetParticlesBulletTrail("nanos-world::P_Bullet_Trail")
new_weapon:SetParticlesBarrel("nanos-world::P_Weapon_BarrelSmoke")
new_weapon:SetParticlesShells("nanos-world::P_Weapon_Shells_762x39")
-- Configures Weapon Sounds
new_weapon:SetSoundDry("nanos-world::A_Rifle_Dry")
new_weapon:SetSoundLoad("nanos-world::A_Rifle_Load")
new_weapon:SetSoundUnload("nanos-world::A_Rifle_Unload")
new_weapon:SetSoundZooming("nanos-world::A_AimZoom")
new_weapon:SetSoundAim("nanos-world::A_Rattle")
new_weapon:SetSoundFire("nanos-world::A_AK47_Shot")
-- Configures Weapon Animations
new_weapon:SetAnimationFire("nanos-world::A_AK47_Fire")
new_weapon:SetAnimationCharacterFire("nanos-world::AM_Mannequin_Sight_Fire")
new_weapon:SetAnimationReload("nanos-world::AM_Mannequin_Reload_Rifle")
-- Configures the Mesh to drop when reloading
new_weapon:SetMagazineMesh("nanos-world::SM_AK47_Mag_Empty")
-- Configures the Crosshair Material
new_weapon:SetCrosshairMaterial("nanos-world::MI_Crosshair_Regular")
Using our Default Weapons Package https://github.com/nanos-world/nanos-world-weapons (already built-in included) for spawning an AK47:
-- Includes the nanos world Default Weapons Package in your Package (you don't need to download it, just include it!)
Package.RequirePackage("nanos-world-weapons")
-- Spawning the AK47
local my_ak47 = NanosWorldWeapons.AK47(Vector(1035, 154, 300), Rotator())
-- Giving the Weapon to a Character
my_character:PickUp(my_ak47)
Constructor Parametersβ
Type | Name | Default |
---|---|---|
Vector | location | Vector(0, 0, 0) |
Rotator | rotation | Rotator(0, 0, 0) |
SkeletalMesh Asset | asset | |
CollisionType | collision_type | CollisionType.Normal |
boolean | gravity_enabled | true |
Functionsβ
Inherited Actor Functions
Returns | Name | Description | |
---|---|---|---|
AddImpulse | Applies a Force in world space to this Actor | ||
AttachTo | Attaches this Actor to another Actor | ||
Destroy | Destroys this Actor | ||
Detach | Detaches this Actor if attached | ||
SetCollision | Sets this Actor's collision type | ||
SetForce | Adds a permanent force to this Actor | ||
SetGravityEnabled | Sets whether gravity is enabled on this Actor | ||
![]() | SetVisibility | Sets the Actor visibility | |
SetHighlightEnabled | Sets whether the highlight is enabled on this Actor, and which highlight index to use | ||
SetOutlineEnabled | Sets whether the outline is enabled on this Actor, and which outline index to use | ||
SetLifeSpan | Sets the time (in seconds) before this Actor is destroyed | ||
SetLocation | Sets this Actor's location in the game world | ||
SetNetworkAuthority | Sets the Player this Actor will have its physics calculated on Network Authority | ||
SetRelativeLocation | Sets this Actor's relative location in local space | ||
SetRelativeRotation | Sets this Actor's relative rotation in local space | ||
SetRotation | Sets this Actor's rotation in the game world | ||
SetScale | Sets this Actor's scale | ||
![]() | SetValue | Sets a value in this Actor, which can be accessed by any package | |
TranslateTo | Smoothly moves this Actor to the specified location | ||
RotateTo | Smoothly rotates this Actor to the specified angle | ||
boolean | HasNetworkAuthority | Gets if the LocalPlayer is currently the Network Authority of this Actor | |
boolean | HasAuthority | Gets if this Actor was spawned by the client side | |
![]() | boolean | IsBeingDestroyed | Gets if this Actor is being destroyed |
![]() | boolean | IsGravityEnabled | Gets whether gravity is enabled on this Actor |
![]() | boolean | IsVisible | Gets whether this actor is Visible or not |
![]() | boolean | IsInWater | Gets if this Actor is in water |
![]() | boolean | IsNetworkDistributed | Gets if this Actor is currently Network Distributed |
![]() | boolean | IsValid | Returns if this Actor is valid (i.e. not destroyed) |
![]() | table | GetAttachedEntities | Gets all Actors attached to this Actor |
![]() | any | GetAttachedTo | Gets the Actor this Actor is attached to |
table | GetBounds | Gets this Actor's bounds | |
![]() | number | GetCollision | Gets this Actor's collision type |
![]() | number | GetID | Gets the universal network ID of this Actor |
![]() | Vector | GetLocation | Gets this Actor's location in the game world |
![]() | Rotator | GetRotation | Gets this Actor's angle in the game world |
![]() | Vector | GetForce | Gets this Actor's scale |
![]() | Vector | GetScale | Gets this Actor's scale |
![]() | string | GetType | Gets the type of this Actor |
![]() | any | GetValue | Gets a value stored on this Actor at the given key |
![]() | Vector | GetVelocity | Returns this Actor's current velocity |
string | AddActorTag | Adds an Unreal Actor Tag to this Actor | |
string | RemoveActorTag` | Remove an Unreal Actor Tag from this Actor | |
table | GetActorTags | Gets all Unreal Actor Tags from this Actor | |
![]() | function | Subscribe | Subscribes to an Event |
![]() | Unsubscribe | Unsubscribes from an Event |
Inherited Pickable Functions
Returns | Name | Description | |
---|---|---|---|
![]() | AddSkeletalMeshAttached | Spawns and attaches a SkeletalMesh to this Pickable | |
![]() | AddStaticMeshAttached | Spawns and attaches a StaticMesh to this Pickable | |
PullUse | Triggers the PullUse event on this Pickable | ||
ReleaseUse | Triggers the ReleaseUse event on this Pickable | ||
![]() | RemoveSkeletalMeshAttached | Removes, if it exists, a SkeletalMesh from this Pickable given its custom ID | |
![]() | RemoveStaticMeshAttached | Removes, if it exists, a StaticMesh from this Pickable given its custom ID | |
SetAttachmentSettings | Sets the adjustment of the Attachment | ||
SetCrosshairMaterial | Sets the crosshair material for this Pickable | ||
SetPickable | Sets if this Pickable can be grabbed | ||
![]() | string | GetAssetName | Gets the name of the asset this Pickable uses |
![]() | Character | GetHandler | Gets the Character, if it exists, that's holding this Pickable |
Inherited Paintable Functions
Returns | Name | Description | |
---|---|---|---|
![]() | SetMaterial | Sets the material at the specified index of this Actor | |
SetMaterialFromWebUI | Sets the material at the specified index of this Actor to a WebUI object | ||
SetMaterialFromSceneCapture | Sets the material at the specified index of this Actor to a SceneCapture object | ||
ResetMaterial | Resets the material from the specified index to the original one | ||
![]() | SetMaterialColorParameter | Sets a Color parameter in this Actorβs material | |
![]() | SetMaterialScalarParameter | Sets a scalar parameter in this Actorβs material | |
![]() | SetMaterialTextureParameter | Sets a texture parameter in this Actor's material to an image on disk | |
![]() | SetMaterialVectorParameter | Sets a Vector parameter in this Actorβs material | |
![]() | SetPhysicalMaterial | Overrides this Actor's Physical Material with a new one |
Returns | Name | Description | |
---|---|---|---|
Reload | Forces this weapon to Reload | ||
SetAmmoBag | Sets this Weapon's Ammo in the Bag | ||
SetAmmoClip | Sets this Weapon's Ammo in the Clip | ||
SetAmmoSettings | Auxiliary for setting and configuring ammo | ||
SetAnimationFire | Animation played by the Weapon when Firing | ||
SetAnimationCharacterFire | Animation played by the Character when Firing | ||
SetAnimationReload | Animation played by the Character when Reloading | ||
SetBulletColor | Set the Bullet Color | ||
SetBulletSettings | Auxiliary for setting and configuring the Bullet | ||
SetCadence | Speed of shots | ||
SetClipCapacity | Capacity of the Weapon's Clip | ||
SetDamage | Base Weapon's Damage | ||
SetHandlingMode | Sets how the Character grabs this Weapon | ||
SetLeftHandTransform | Left Hand Offset | ||
SetMagazineMesh | The mesh used when the Character reloads the weapon. Will drop this Mesh as an animation effect. | ||
SetParticlesBulletTrail | Particle of the Bullet flying | ||
SetParticlesBarrel | Particle of the Fire Blast in the muzzle | ||
SetParticlesShells | Particle of the empty bullet flying from the weapon when shooting | ||
SetRightHandOffset | Offset of Right Hand. To position relative to the camera. | ||
SetSightFOVMultiplier | The FOV multiplier when ADS | ||
SetSightTransform | Offset applied to align player's head to weapon's sight and rotation applied on the weapon when ADS | ||
SetSoundDry | Sound when weapon has not bullet and try to shoot | ||
SetSoundLoad | Sound when Loading a magazine | ||
SetSoundUnload | Sound when Unloading a magazine | ||
SetSoundZooming | Sound when Zooming | ||
SetSoundAim | Sound when Aiming | ||
SetSoundFire | Sound when Shooting | ||
SetSoundFireLastBullets | Sound when Shooting last bullets | ||
SetSpread | Base Weapon's Spread (the higher the less precision) | ||
SetRecoil | Base Weapon's Recoil Multiplier | ||
SetUsageSettings | Sets if the Weapon can hold to keep firing and if it needs to release to fire | ||
SetWallbangSettings | Sets how the bullets will pass through walls | ||
![]() | number | GetAmmoBag | Gets this Weapon's Ammo Bag |
![]() | number | GetAmmoClip | Gets this Weapon's Ammo Clip |
![]() | number | GetAmmoToReload | |
![]() | string | GetAnimationCharacterFire | |
![]() | string | GetAnimationFire | |
![]() | Color | GetBulletColor | |
![]() | number | GetBulletCount | |
![]() | number | GetCadence | |
![]() | boolean | GetCanHoldUse | |
![]() | number | GetClipCapacity | |
![]() | number | GetDamage | |
![]() | HandlingMode | GetHandlingMode | |
![]() | boolean | GetHoldReleaseUse | |
![]() | boolean | GetLeftHandLocation | |
![]() | string | GetMagazineMesh | |
![]() | string | GetParticlesBulletTrail | |
![]() | string | GetParticlesBarrel | |
![]() | string | GetParticlesShells | |
![]() | Vector | GetRightHandOffset | |
![]() | number | GetSightLocation | |
![]() | number | GetSightRotation | |
![]() | number | GetSightFOVMultiplier | |
![]() | string | GetSoundDry | |
![]() | string | GetSoundLoad | |
![]() | string | GetSoundUnload | |
![]() | string | GetSoundZooming | |
![]() | string | GetSoundAim | |
![]() | string | GetSoundFire | |
![]() | number | GetSpread | |
![]() | number | GetRecoil |
Eventsβ
Inherited Actor Events
Name | Description | |
---|---|---|
Destroy | Triggered when an Actor is destroyed | |
Spawn | Triggered when an Actor is spawned/created | |
ValueChange | Triggered when an Actor has a value changed with :SetValue() |
Inherited Pickable Events
Name | Description | |
---|---|---|
Drop | When a Character drops this Pickable | |
Hit | When this Pickable hits something | |
Interact | When a Character interacts with this Pickable | |
PickUp | When a Character picks this up | |
PullUse | When a Character presses the use button for this Pickable (i.e. clicks left mouse button with this equipped) | |
ReleaseUse | When a Character releases the use button for this Pickable (i.e. releases left mouse button with this equipped) |
Name | Description |
---|---|
Fire | When Weapon is fired |
Reload | When Weapon is reloaded |
AmmoClipChanged | When the Ammo Clip is changed |
AmmoBagChanged | When the Ammo Bag is changed |
Functions Detailedβ

Reload
β
Forces this Weapon to reload (only if being handled by a Character)
my_weapon:Reload()

SetAmmoBag
β
Sets this Weapon's Ammo in the Bag
my_weapon:SetAmmoBag(new_ammo)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | new_ammo |

SetAmmoClip
β
Sets this Weapon's Ammo in the Clip
my_weapon:SetAmmoClip(new_ammo)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | new_ammo |

SetAmmoSettings
β
Aux for setting and configuring ammo
my_weapon:SetAmmoSettings(ammo_clip, ammo_bag, ammo_to_reload, clip_capacity)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | ammo_clip | ||
number | ammo_bag | ||
number | ammo_to_reload | ammo_clip | The amount of ammo which will be effectively reloaded in the clip when reloading |
number | clip_capacity | ammo_clip | How much ammo the clip can hold without needing to reload |

SetAnimationFire
β
Animation played by the Weapon when Firing
my_weapon:SetAnimationFire(animation_asset_path, play_rate)
Type | Parameter | Default Value | Description |
---|---|---|---|
Animation Asset | animation_asset_path | ||
number | play_rate | 1 |

SetAnimationCharacterFire
β
Animation played by the Character when Firing
my_weapon:SetAnimationCharacterFire(animation_asset_path, play_rate)
Type | Parameter | Default Value | Description |
---|---|---|---|
Animation Asset | animation_asset_path | ||
number | play_rate | 1 |

SetAnimationReload
β
Animation played by the Character when Reloading
Currently this animation must be one of the default ones:
AM_Mannequin_Reload_Rifle
,AM_Mannequin_Reload_Pistol
orAM_Mannequin_Reload_Shotgun
, as they have internal triggers to finish the reload
my_weapon:SetAnimationReload(animation_asset_path, play_rate)
Type | Parameter | Default Value | Description |
---|---|---|---|
Animation Asset | animation_asset_path | ||
number | play_rate | 1 |

SetBulletColor
β
Set the Bullet Color
Only has effect if using Bullet Trail particle
P_Bullet_Trail
or if you particle has the Color parameter
my_weapon:SetBulletColor(color)
Type | Parameter | Default Value | Description |
---|---|---|---|
Color | color |

SetBulletSettings
β
Aux for setting and configuring the Bullet
my_weapon:SetBulletSettings(bullet_count, bullet_max_distance, bullet_velocity, bullet_color)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | bullet_count | 1 for common weapons, > 1 for shotguns | |
number | bullet_max_distance | ||
number | bullet_velocity | Visuals only | |
Color | bullet_color |

SetCadence
β
Speed of shots
my_weapon:SetCadence(cadence)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | cadence | 1 shot at each cadence second |

SetClipCapacity
β
Capacity of the Weapon's Clip
my_weapon:SetClipCapacity(clip)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | clip |

SetDamage
β
Base Weapon's Damage
This will be multiplied by multiplier factors when hitting specific bones
my_weapon:SetDamage(damage)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | damage |

SetHandlingMode
β
Sets how the Character grabs this Weapon
my_weapon:SetHandlingMode(mode)
Type | Parameter | Default Value | Description |
---|---|---|---|
HandlingMode | mode |

SetLeftHandTransform
β
Left Hand Offset
my_weapon:SetLeftHandTransform(location, rotation)
Type | Parameter | Default Value | Description |
---|---|---|---|
Vector | location | ||
Rotator | rotation |

SetMagazineMesh
β
The mesh used when the Character reloads the weapon. Will drop this Mesh as an animation effect.
my_weapon:SetMagazineMesh(static_mesh_asset_path, magazine_mesh_hide_bone)
Type | Parameter | Default Value | Description |
---|---|---|---|
StaticMesh Asset | static_mesh_asset_path | ||
string | magazine_mesh_hide_bone | b_gun_mag | Bone to hide when reloading the weapon |

SetParticlesBulletTrail
β
Particle of the Bullet flying
my_weapon:SetParticlesBulletTrail(particle_asset_path)
Type | Parameter | Default Value | Description |
---|---|---|---|
Particle Asset | particle_asset_path |

SetParticlesBarrel
β
Particle of the Fire Blast in the muzzle
my_weapon:SetParticlesBarrel(particle_asset_path)
Type | Parameter | Default Value | Description |
---|---|---|---|
Particle Asset | particle_asset_path |

SetParticlesShells
β
Particle of the empty bullet flying from the weapon when shooting
my_weapon:SetParticlesShells(particle_asset_path)
Type | Parameter | Default Value | Description |
---|---|---|---|
Particle Asset | particle_asset_path |

SetRightHandOffset
β
Offset of Right Hand. To position relative to the camera.
my_weapon:SetRightHandOffset(offset)
Type | Parameter | Default Value | Description |
---|---|---|---|
Vector | offset |

SetSightFOVMultiplier
β
The FOV multiplier when ADS
my_weapon:SetSightFOVMultiplier(multiplier)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | multiplier |

SetSightTransform
β
Offset applied to align player's head to weapon's sight and rotation applied on the weapon when ADS
my_weapon:SetSightTransform(location, rotation)
Type | Parameter | Default Value | Description |
---|---|---|---|
Vector | location | ||
Rotator | rotation |

SetSoundDry
β
Sound when weapon has not bullet and try to shoot
my_weapon:SetSoundDry(sound_asset_path, volume, pitch)
Type | Parameter | Default Value | Description |
---|---|---|---|
Sound Asset or Special Path | sound_asset_path | ||
number | volume | 1 | |
number | pitch | 1 |

SetSoundLoad
β
Sound when Loading a magazine
my_weapon:SetSoundLoad(sound_asset_path, volume, pitch)
Type | Parameter | Default Value | Description |
---|---|---|---|
Sound Asset or Special Path | sound_asset_path | ||
number | volume | 1 | |
number | pitch | 1 |

SetSoundUnload
β
Sound when Unloading a magazine
my_weapon:SetSoundUnload(sound_asset_path, volume, pitch)
Type | Parameter | Default Value | Description |
---|---|---|---|
Sound Asset or Special Path | sound_asset_path | ||
number | volume | 1 | |
number | pitch | 1 |

SetSoundZooming
β
Sound when Zooming
my_weapon:SetSoundZooming(sound_asset_path, volume, pitch)
Type | Parameter | Default Value | Description |
---|---|---|---|
Sound Asset or Special Path | sound_asset_path | ||
number | volume | 1 | |
number | pitch | 1 |

SetSoundAim
β
Sound when Aiming
my_weapon:SetSoundAim(sound_asset_path, volume, pitch)
Type | Parameter | Default Value | Description |
---|---|---|---|
Sound Asset or Special Path | sound_asset_path | ||
number | volume | 1 | |
number | pitch | 1 |

SetSoundFire
β
Sound when Shooting
my_weapon:SetSoundFire(sound_asset_path, volume, pitch)
Type | Parameter | Default Value | Description |
---|---|---|---|
Sound Asset or Special Path | sound_asset_path | ||
number | volume | 1 | |
number | pitch | 1 |

SetSoundFireLastBullets
β
Sound when firing with only having X remaining bullets in the magazine, useful for last shot 'ping' or sound when low on bullets
my_weapon:SetSoundFireLastBullets(sound_asset_path, remaining_bullets_count)
Type | Parameter | Default Value | Description |
---|---|---|---|
Sound Asset or Special Path | sound_asset_path | ||
number | remaining_bullets_count | 1 | The amount of remaining bullet to start playing this sound |

SetSpread
β
Base Weapon's Spread (the higher the less precision - recommended value: 20)
my_weapon:SetSpread(spread)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | spread |

SetRecoil
β
Base Weapon's Recoil - 0 means no Recoil, default is 1
my_weapon:SetRecoil(damage)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | recoil |

SetUsageSettings
β
Sets if the Weapon can hold to keep firing and if it needs to release to fire
my_weapon:SetUsageSettings(can_hold_use, hold_release_use)
Type | Parameter | Default Value | Description |
---|---|---|---|
boolean | can_hold_use | ||
boolean | hold_release_use |

SetWallbangSettings
β
Sets how the bullet will pass through walls
my_weapon:SetWallbangSettings(max_distance, damage_multiplier)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | max_distance | Max distance to pass through another wall | |
number | damage_multiplier | Damage given if wallbangged |

GetAmmoBag
β
Gets this Weapon's Ammo Bag
Returns number
my_weapon:GetAmmoBag()

GetAmmoClip
β
Gets this Weapon's Ammo Clip
Returns number
my_weapon:GetAmmoClip()

GetAmmoToReload
β
Returns number
my_weapon:GetAmmoToReload()

GetHandlingMode
β
Returns HandlingMode
my_weapon:GetHandlingMode()

GetAnimationCharacterFire
β
Returns string
my_weapon:GetAnimationCharacterFire()

GetAnimationFire
β
Returns string
my_weapon:GetAnimationFire()

GetMagazineMesh
β
Returns string
my_weapon:GetMagazineMesh()

GetParticlesBulletTrail
β
Returns string
my_weapon:GetParticlesBulletTrail()

GetParticlesBarrel
β
Returns string
my_weapon:GetParticlesBarrel()

GetParticlesShells
β
Returns string
my_weapon:GetParticlesShells()

GetSoundDry
β
Returns string
my_weapon:GetSoundDry()

GetSoundLoad
β
Returns string
my_weapon:GetSoundLoad()

GetSoundUnload
β
Returns string
my_weapon:GetSoundUnload()

GetSoundZooming
β
Returns string
my_weapon:GetSoundZooming()

GetSoundAim
β
Returns string
my_weapon:GetSoundAim()

GetSoundFire
β
Returns string
my_weapon:GetSoundFire()

GetCanHoldUse
β
Returns string
my_weapon:GetCanHoldUse()

GetHoldReleaseUse
β
Returns boolean
my_weapon:GetHoldReleaseUse()

GetBulletCount
β
Returns boolean
my_weapon:GetBulletCount()

GetBulletColor
β
Returns Color
my_weapon:GetBulletColor()

GetCadence
β
Returns number
my_weapon:GetCadence()

GetClipCapacity
β
Returns number
my_weapon:GetClipCapacity()

GetDamage
β
Returns number
my_weapon:GetDamage()

GetRightHandOffset
β
Returns Vector
my_weapon:GetRightHandOffset()

GetLeftHandLocation
β
Returns Vector
my_weapon:GetLeftHandLocation()

GetLeftHandRotation
β
Returns Rotator
my_weapon:GetLeftHandRotation()

GetSightLocation
β
Returns Vector
my_weapon:GetSightLocation()

GetSightRotation
β
Returns Rotator
my_weapon:GetSightRotation()

GetSightFOVMultiplier
β
Returns number
my_weapon:GetSightFOVMultiplier()

GetSpread
β
Returns number
my_weapon:GetSpread()

GetRecoil
β
Returns number
my_weapon:GetRecoil()
Events Detailedβ
Fire
β
Triggered when Weapon fires (this will be triggered for each shot)
Weapon.Subscribe("Fire", function(self, shooter)
end)
Type | Parameter | Description |
---|---|---|
Weapon | self | |
Character | shooter |
Reload
β
When a Weapon is reloaded, optionally by a Character
Weapon.Subscribe("Reload", function(self, character, ammo_to_reload)
end)
Type | Parameter | Description |
---|---|---|
Weapon | self | |
Character | character | |
number | ammo_to_reload |
AmmoClipChanged
β
When the Ammo Clip is changed, by reloading or manually setting through scripting
Weapon.Subscribe("AmmoClipChanged", function(self, old_ammo_clip, new_ammo_clip)
end)
Type | Parameter | Description |
---|---|---|
Weapon | self | |
number | old_ammo_clip | |
number | new_ammo_clip |
AmmoBagChanged
β
When the Ammo Bag is changed, by reloading or manually setting through scripting
Weapon.Subscribe("AmmoBagChanged", function(self, old_ammo_bag, new_ammo_bag)
end)
Type | Parameter | Description |
---|---|---|
Weapon | self | |
number | old_ammo_bag | |
number | new_ammo_bag |