xPlayer.addWeaponComponent

1
xPlayer.addWeaponComponent(weaponName, weaponComponent)

This function adds a weapon component to a weapon, if the player has it, the available component list can be found in the weapon configuration file.

Arguments

Argument Data Type Optional Default Value Explanation
weaponName string No - Weapon name
weaponComponent string No - Weapon component

xPlayer.addWeaponComponent Exemplo

1
2
3
xPlayer.addWeapon('WEAPON_ASSAULTRIFLE', 50)
xPlayer.addWeaponComponent('WEAPON_ASSAULTRIFLE', 'clip_drum')
xPlayer.addWeaponComponent('WEAPON_ASSAULTRIFLE', 'flashlight')