Cuberite Forum

Full Version: More Chat Support?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way to capture the out going message?

Example: 
  • Check to see what the message starts with "Example lowercase"
  • Replace the chat message
It would be nice to be able to do this.
You can use the OnChat hook to do that.
For example you can use this to make the first character uppercase:
function OnChat(a_Player, a_Message)
	a_Message = (a_Message:gsub("^%l", string.upper))
	return false, a_Message
end
Did you use regex for "^%l"