Hooks ChatMessageAdjust - brianhang/nutscript2 GitHub Wiki

Description

newMessage = ChatMessageAdjust(speaker, mode, message)

This server hook is called before a chat message is delivered. This allows for changes to be made to messages being sent if a string is returned.

Parameters

Name Description
speaker The Player that is talking.
mode A string that is the identifier for the chat mode.
message A string that contains the chat message.

Returns

Name Description
newMessage A string containing the overwritten chat message.

Example

-- Appends an exclamation mark after yelling chat messages.
function GM:ChatMessageAdjust(speaker, mode, message)
    if (mode == "y") then
        return message.."!"
    end
end