Hooks
Hooks provided by the Captions module for managing on-screen caption displays.
Overview
The Captions module provides a comprehensive API for displaying timed on-screen text overlays suitable for tutorials, story events, and narrative sequences. It supports both server and client-triggered captions with customizable duration, positioning, and styling. The module includes built-in commands for caption management and extensive hook integration for synchronizing caption events across players and customizing caption behavior.
BroadcastCaptionCommand
đ Purpose
Called when an admin uses the broadcast caption command to send a caption to all players.
â° When Called
After the command is validated but before captions are sent to players.
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
client |
Player | The admin who executed the command |
text |
string | The caption text to broadcast |
duration |
number | The duration in seconds for the caption display |
âŠī¸ Returns
nil
đ Realm
Server
CaptionFinished
đ Purpose
Called when a caption display has finished on the client.
â° When Called
After the caption has been removed from the screen.
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
client |
Player, optional | The player whose caption finished (server-side only) |
âŠī¸ Returns
nil
đ Realm
Client (no parameters) or Server (with client parameter)
CaptionStarted
đ Purpose
Called when a caption display has started on the client.
â° When Called
After the caption has been displayed on screen.
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
client |
Player, optional | The player whose caption started (server-side only) |
text |
string | The caption text being displayed |
duration |
number | The duration in seconds for the caption display |
âŠī¸ Returns
nil
đ Realm
Client (text, duration) or Server (client, text, duration)
SendCaptionCommand
đ Purpose
Called when an admin uses the send caption command to send a caption to a specific player.
â° When Called
After the command is validated but before the caption is sent to the target player.
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
client |
Player | The admin who executed the command |
target |
Player | The target player who will receive the caption |
text |
string | The caption text to send |
duration |
number | The duration in seconds for the caption display |
âŠī¸ Returns
nil
đ Realm
Server