Skip to main content

TogglingFlashlight

Gets called when the player is toggling a flashlight.

Start a script section

!-- OnEvent TogglingFlashlight
-- require @evPlayer *evLightItem $evNewState $evIsAllowed

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

Injected variables

VariableTypeDescription
@evPlayerplayer valueGets the player who is toggling the flashlight.
*evLightItemreference to LightItem objectGets the flashlight that is being toggled.
$evNewStatebool valueGets whether the flashlight is being toggled to on or off state.
$evIsAllowedbool valueWhether the event is allowed to run.