onPlayerChat
From Liberty Unleashed Wiki
This is called when a player sends a chat message. This event is called even if the player is muted.
Syntax
function onPlayerChat( Player player, string message )
Arguments
- player - The player who spoke
- message - The message the player sent
Returns
- 1 - Send the message to other clients, unless they're muted
- 0 - Returning 0 will cancel this message and effectively mute the player
Example
This example checks if the player has been muted, and if they are, sends a message to them stating they have been muted.
function onPlayerChat( player, text ) { if ( player.Muted ) { MessagePlayer( "You are currently muted.", player ); } return 1; }
Notes
The functions MessagePlayer and Player.Muted were used in this example. More info about them in the corresponding pages.
Related Events
- onPlayerAction
- onPlayerArmourChange
- onPlayerCashChange
- onPlayerChat
- onPlayerCommand
- onPlayerConnect
- onPlayerDeath
- onPlayerFall
- onPlayerHealthChange
- onPlayerIslandChange
- onPlayerJoin
- onPlayerKeyStateChange
- onPlayerKill
- onPlayerPart
- onPlayerScoreChange
- onPlayerSkinChange
- onPlayerSpawn
- onPlayerUpdate
- onPlayerTeamChange
- onPlayerUseDetonator
- onPlayerVirtualWorldChange
- onPlayerWeaponChange