PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

FilterStringForBroadcast

Filters a string sent from playerFrom for broadcast to no particular target. The filtered message has more restrictions than Chat/FilterStringAsync.

Some examples of where this method could be used:

  • -Message walls
  • -Cross-server shouts
  • -User-created signs

Calling FilterString from LocalScripts is deprecated and will be disabled in the future. Text filtering should be done from server-side Scripts using FilterStringAsync.

Note: A game not using this filter function for custom chat or other user generated text may be subjected to moderation action.

Parameters

Name Type Default Description

Message string being filtered

Instance of the player sending the message

Returns

Return Type Summary

Filtered message string


Code Samples


Chat:FilterStringForBroadcast

The following example shows a simple way to use the FilterStringForBroadcast function. The example uses the message variable as the stringToFilter argument and the local player as the playerFrom argument.

The example then prints the result of the filtering function, FilteredString.