Custom Chat Bug [Error 267]

Error 267 with custom chat. Using ROBLOX’s filtering system. Tried testing yield error.


local function filterChat(text, playerFrom, playerTo, area)

local filteredMessage

local succ, err = pcall(function()
filteredMessage = game:GetService("Chat"):FilterStringAsync(text, playerFrom, playerTo)
end)
wait(0.5)
if not succ then
filteredMessage = "<ERROR_FILTERING_CHAT>"
else
game.ReplicatedStorage.ARCONSYSTEM.events.ChatEvent:FireClient(playerTo, playerFrom, filteredMessage, area)
end
end

Custom chats are not allowed on Roblox. This error might be in place of preventing this type of stuff

Then why would there be an option to customize chat including a filtering system internally made by Roblox accessible to developers?

1 Like

Really good point there! Suggest just using the default and edit it with the roblox Scripts that is managed for the chat.

1 Like

Can you print out text, playerFrom, playerTo? Nothing looks wrong based on what you wrote. By error 267 you meaning what err is after the pcall?

I assume it must be one of the parameters because I tested this in studio:

local function filterChat(text, playerFrom, playerTo, area)
	local filteredMessage

	local succ, err = pcall(function()
		filteredMessage = game:GetService("Chat"):FilterStringAsync(text, playerFrom, playerTo)
	end)
	
	print(succ and "Success:" or "Error:", succ and filteredMessage or err)
end

filterChat("test", game.Players.Vulkarin, game.Players.Vulkarin)  

and the output was: Success: test


The default won’t work for everything, there’s nothing wrong with filtering things outside of the built in roblox chat.

Not true at all, maybe you mean custom filtering.

1 Like

@Vulkarin It must have been the game itself. Uploading it to another game had no errors.

1 Like