Skip to main content

ChangingAttachments

Gets called when player is changing weapon attachments.

Start a script section

!-- OnEvent ChangingAttachments
-- require @evPlayer *evFirearmItem $evOldAttachments $evNewAttachments $evIsAllowed

# Add your instructions here
  • Group: PlayerEvents
  • Cancellable: Yes
  • Event data: PlayerChangingAttachmentsEventArgs

Injected variables

VariableTypeDescription
@evPlayerplayer valueGets the player that invoked the event.
*evFirearmItemreference to FirearmItem objectThe weapon that is involved in the event.
$evOldAttachmentsnumber valueGets previous attachments code.
$evNewAttachmentsnumber valueGets or sets new attachments code.
$evIsAllowedbool valueWhether the event is allowed to run.