Can someone assist me with implementing ROBLOX’s chat filter into a script, The way it works is if you press a certain keybinding whilst holding a specific tool, in red chat a pre-made message is posted above your head. Due to this being a form of communication, it requires ROBLOX’s chat filter to be used. I decided to test to see if it filters. It does not.
Basically, what I am trying to say is. Can someone help me edit a script to ensure it filters to text.
To clarify, this issue is on the Player, not Studio Test.
(Sorry for this being so messy. If any Staff want to edit this feel free.)
The filter doesn’t work in studio.
Additionally, this is more appropriate in #development-support:scripting-support.
1 Like
I have moved it.
It’s not Studio. It’s also the Player. I’ll edit my post now to be more specific.
If it’s a message you, as a developer, wrote and is hard-coded; you don’t need to filter it.
Since Roblox’s chat filter returns unaltered text if the input is not filtered, you can check if the call to TextService:FilterStringAsync (TextService | Documentation - Roblox Creator Hub) returns the same value as the value you passed in. If it doesn’t, then just tell the player that they can’t send the message because it was filtered.
If you want the message to go above the sender’s head on the sender’s client before it appears for other players, just create it above the character’s head on the sender’s client when you send the message to the server.
1 Like
So if for example, My tool is Handcuffs, and while equipped you press Z and the message above your head starts reading the Detainee’s rights, that message does not have to be filtered?
I see. I did not know that. Thank you.