Is filtering on the client required?

Hey there, I am currently making a radio script and ran into a conundrum.

Basically when i send a message on the radio i want it to appear instantly for the client, so that there is minimal input lag and a nice user experience. The problem with this is that i cannot filter text on the client, meaning that messages i send on the radio (for the client) wont be filtered!

If that didnt make any sense, when the user sends a message, for them it will appear unfiltered, for everyone else itll be filtered, and any messages other clients send will also appear filtered.

i looked it up and apparently this is okay? i really just want to be safe before i proceed and im wondering if there are any other options, thanks!

When you send a message, couldn’t you do it like FireClient for the client you wanna do it for, and pass that Filtered Text? You can use this function here to Filter the text: https://developer.roblox.com/en-us/api-reference/function/Chat/FilterStringForBroadcast

I think it’s allowed to not be filtered on the client, but just to be 100% sure you won’t get moderated, just filter it to everyone even with the player who sent the message.

It’s better to be safe than sorry.

not sure how i can without that input lag, you cant filter on the client so thats the issue :expressionless:

If you are concerned of input delay, this means there is a problem with your script that is causing the lag or another script causing the lag.

well i have to send data from the client to the server with remote events and then send it back to the client with a filtered result, i dont believe its a problem with my script, rather just the server itself which will always have some degree of lag, albeit extremely minimal.

everything seen by a client that is not yourself has to be filtered, that includes user-generated text of any kind

this is what i was doing, but i got some input lag which i didnt like hence resorting to this.

the input lag was id say around half a second, maybe im just picky but it didnt feel intuitive to use.

everything seen by other people is filtered. only the messages youve sent arent filtered but only for you.

you can do it like roblox’ chat, replace the clients message with the filtered one later on

so replicate it first on the client and then replace it with a filtered message once the server catches up?

yes, that would be the idea :+1:

1 Like