Skip to content

Where to add custom lua to a weapon

Vuthakral edited this page Oct 18, 2020 · 1 revision

The different stages (functions) of where you can implement custom lua into each base are described below. Please note that the gun base & battery base are heavily intertwined, so some functions in the gun base are applicable to the battery base as well. If there is somewhere you need a custom function injected to work for your project/weapon, feel free to ask me through Steam/Discord or submitting it as a new issue on this github.

Gun Base

  • SWEP:DoCustomReloadStartEvents()
    Called when a reload is successfully initiated, no args. Not called by manual reloading (yet)

  • SWEP:DoCustomReloadEndEvents()
    See above, but s/initiated/ended/

  • SWEP:DoCustomPrimaryAttackEvents()
    Self explanatory, but only called when an attack is valid (can fire).

  • DoCustomSecondaryAttackEvents()
    See above.

  • SWEP:DoScriptedSecondaryAttack()
    todo: fix

Battery Base

  • SWEP:DoCustomVentEvents()
    Called when a weapon has started venting, not overheating.

  • SWEP:DoCustomVentHoldEvents()
    When the venting function loops from being held.

  • SWEP:DoCustomFinishVentEvents()
    Called when a vent is finished.

  • SWEP:DoCustomOverheatEvents()
    Called when the weapon overheats.

Clone this wiki locally