object.add_weapon

This function attempts to create a new weapon of the desired type, and give it to the biped that the function is called on. If that biped is already carrying two weapons, then the function will fail, and no new weapon will be created. Similarly, the function doesn't seem to do anything when called on something that is not a biped.

Arguments

weapon

A type of object that can exist in the game world.

mode

One of the following values:

primary
Attempts to give the weapon to the biped. If successful, then any weapon the biped was already holding will be holstered, and the new weapon will be switched into their hands.
secondary
Attempts to give the weapon to the biped.
force
Forcibly adds the weapon to the biped and switches them to use it.

Example

global.object[0].add_weapon(assault_rifle, force)

Notes

See also