the script works fine in studio but not in the actual game. in game, the message that is printed into the chatbox is simply "Value." the chatbox script works fine and so does most of this script except for the line with the filter. script that does the filtering and hooks is below.
local chatstorage = game.Workspace.ChatStorage
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:connect(function(msg)
local s = Instance.new('StringValue', chatstorage)
local filteredMsg = game:GetService("Chat"):FilterStringAsync(msg, plr, plr)
s.Name = plr.Name..': '..filteredMsg
end)
end)
as you can see I mark the player as both the sender and the receiver as the wiki said to. the problem is that "filteredMsg" is not being changed to a filtered message, at least I am pretty sure it is. the chatbox script is located in a localscript inside of the chatbox GUI and is hooked to ChildAdded in the chatstorage folder.
this obviously means that FilterStringAsync functions differently in studio and actually in game. I actually noticed this already because it doesn't actually filter the chat in studio which is odd.
Edit: Here's what I changed
local filteredMsg
local recievers = game.Players:GetChildren()
for i,v in pairs (recievers) do
filteredMsg = game:GetService("Chat"):FilterStringAsync(msg, plr, v)
end
I replaced the fifth line with this block of code. This loops through all of the players in the game and filters the message again for each player, at least it should, and it works in studio, but again does not work when I actually play the game on roblox. Keep in mind that this is part of the function that is connected to plr.Chatted so the recievers table will be updated every new message.

2 comments
Dont mark the sender as a receiver, do a literate loop through all the players, and filter the string accordingly, then fire an event to that client. Set the receiver to the person "receiving" the chat message. Keep the send as the person who sent it. Remember that, if you keep the receiver as the sender, someone who has different filter properties (<13 users), will still see the same as someone o
Changed it to loop through all players, still doesn't work.