Hooks
Hooks provided by the Flashlight module for managing flashlight functionality.
Overview
The Flashlight module adds a serious flashlight with dynamic light, darkening of surroundings when turned off, adjustable brightness, and keybind toggle support.. It provides comprehensive hook integration for customizing managing flashlight functionality and extending functionality.
CanPlayerToggleFlashlight
đ Purpose
Called to determine if a player can toggle their flashlight.
â° When Called
Before the flashlight toggle is processed.
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
client |
Player | The player attempting to toggle |
isEnabled |
boolean | Whether the flashlight is being turned on (true) or off (false) |
âŠī¸ Returns
boolean - Return false to prevent toggle
đ Realm
Server
Overview
The Flashlight module adds a serious flashlight with dynamic light, darkening of surroundings when turned off, adjustable brightness, and keybind toggle support.. It provides comprehensive hook integration for customizing managing flashlight functionality and extending functionality.
PlayerToggleFlashlight
đ Purpose
Called when a player successfully toggles their flashlight.
â° When Called
After the flashlight state is changed.
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
client |
Player | The player who toggled the flashlight |
isEnabled |
boolean | Whether the flashlight is now on (true) or off (false) |
âŠī¸ Returns
nil
đ Realm
Server
Overview
The Flashlight module adds a serious flashlight with dynamic light, darkening of surroundings when turned off, adjustable brightness, and keybind toggle support.. It provides comprehensive hook integration for customizing managing flashlight functionality and extending functionality.
PrePlayerToggleFlashlight
đ Purpose
Called before a player's flashlight toggle is processed.
â° When Called
Before any validation or checks are performed.
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
client |
Player | The player attempting to toggle |
isEnabled |
boolean | Whether the flashlight is being turned on (true) or off (false) |
âŠī¸ Returns
boolean - Return false to prevent toggle
đ Realm
Server