How to use RegisterChatCallback

hi, i have this code:


game.Chat:RegisterChatCallback(Enum.ChatCallbackType.OnServerReceivingMessage,function(name,obj,ChannelName)
	local message = obj
    local isAdmin,Type
	for t,plr2 in next,developers do
		warn(type(name))
	    if plr2 == name then
		    isAdmin=true
			Type = t
			break
		end
	end
	if isAdmin then
		warn(true,type(message))
	    message.Text = '{'..Type..'} '..message.Text
	end
end)

it always warns ‘table’ but how to get then the transmiter’s name?

I am confused about what are you trying to achieve here, can you be please more specific?

if an player’s name is in a table and he chat his be: {TypeOfRank} [PlrName]: Message

Are you trying to add chat tags to certain users? Don’t use RegisterChatCallback for this. Add their tags via the ChatSpeaker object’s extra data methods.

On my tutorial about using RegisterChatCallback (specifically for modifying chat settings), someone posed a question about tags to which I answered. You can salvage the code there to understand how to apply tags to users. View that here:

If this isn’t sufficient enough (especially with respect to the braces), you will need to add a new chat type processor that sanitises the tags to be between braces as opposed to brackets.

3 Likes