Exports

Exports

Prodigy Chat provides exports that can be used by other resources to interact with the chat system.

Client-Side Exports

GetProdigyTimestamp

Returns a formatted timestamp string in the format [HH:MM:SS].

Usage:

local timestamp = exports['prodigy-chat']:GetProdigyTimestamp()
-- Returns: "[14:30:25]"

Example:

local timestamp = exports['prodigy-chat']:GetProdigyTimestamp()
print(timestamp) -- Output: [14:30:25]

Returns:

  • string - Formatted timestamp string [HH:MM:SS]

Server-Side Exports

getMaskData

Returns the current mask data table containing all masked players.

Usage:

Returns:

  • table - Array of mask data entries with the following structure:

Example:

Events

While not exports, Prodigy Chat also triggers several events that other resources can listen to:

Client Events

prodigy-chat:updateFont

Triggered when chat font is changed.

Parameters:

  • fontFamily (string) - The new font family name

Example:

prodigy-chat:updateSize

Triggered when chat size is changed.

Parameters:

  • size (string) - The new size ("small", "medium", "large", "xlarge")

Example:

prodigy-chat:updateMaskState

Triggered when a player's mask state changes.

Parameters:

  • isMasked (boolean) - Whether the player is masked

  • maskName (string, optional) - The masked name if masked

Example:

Server Events

prodigy-chat:maskStateChanged

Triggered when a player's mask state changes on the server.

Parameters:

  • source (number) - Player server ID

  • isMasked (boolean) - Whether the player is masked

  • maskName (string, optional) - The masked name if masked

Example:

Integration Examples

Using Timestamp in Custom Chat

Checking Mask State

Listening to Mask Changes

Notes

  • All exports are available immediately after the resource starts

  • Client exports can only be called from client-side scripts

  • Server exports can only be called from server-side scripts

  • Events are triggered automatically by the chat system

  • Always check if exports exist before using them in your code

Troubleshooting

Export Not Found

If you get an error that an export is not found:

  1. Ensure Prodigy Chat is started and loaded

  2. Check the resource name matches exactly: 'prodigy-chat'

  3. Verify you're calling the export from the correct side (client/server)

  4. Check server console for any resource errors

Export Returns Nil

  • For getMaskData: Returns an empty table {} if no players are masked

  • For GetProdigyTimestamp: Should always return a string, check for typos in the export name

Last updated