1.) A preset list of names for people to choose from. (Lets be honest this way isn’t fun or creative)
2.) If the name gets tagged then don’t update their nickname and tell them to try something else.
3.) Allow them to use their Username as a nickname. Some usernames get tagged when you FilterStringForBroadcast so just tell the server that they want to use their username which you would then not have to filter. Just tell the server to use .Name.
Obviously since you are going for a serious roleplay environment then #3 might not be great. #2 is probably your best bet.
You might be able to get away with a preset list of nicknames for each users. This wouldn’t require any text input from a user, however it would have to be updated by developers each time it was to be updated. This kinda depends on how you actually want your game to work though and you might want to verify that its okay to do first.
I’ve previously used a preset list of first & last names which people could combine together to make their name. The main issue with this, aside from not being able to have the name you want, is that it still can’t be said in game. If I went down this route, I’d need to be able to whitelist these names from the chat filter somehow.
Since you are doing a realistic style roleplay how about you whitelist things like “Officer” and other prefixes, so that will be applied automatically? For example if they are a police officer and the nickname they chose is “WaffleSlinger3000” then it would apply the prefix “Officer” to their nickname. Officer WaffleSlinger3000. Assuming you don’t already have it like this of course.
You could even be more advanced to detect certain strings within messages to then display certain text. Say i type “Hello my name is, /me.” You could set it up so that a string containing “/me” returns the users nickname and prefix in that spot. This could be done using a preset list or a simple first name they can choose (assuming the one name isnt filtered).
The thing is, the name is split into two parts - the first name and the last name. ROBLOX censors a vast majority of names and using a username is off the table. Regardless of whatever solution I get to the custom name system, I still ideally need a way to modify the chat filter to whitelist names. I know Firestone did something like this with their radio system.
Well you can always store the full name somewhere, concatenate the first name and the last name seperated by a space. And i know firestone did their radios so they could have calsigns, however i thought those were manually added and didnt need filtering. Could be wrong though.
Their script has a list of words that get bypassed through the filter, mainly locations and codes. This is something I want to do with the main chat & a list of names.
When the player tries to pick a name, call a check to see if the inputted filtered string contains “#”, and require them to submit another name until they get a valid name.
Firestone doesn’t whitelist names and if they do, they’re doing it illegally. Whitelisting from the filter is not permitted, especially if the input is dependent on what a client sends.
I’m not sure anyone’s understanding my problem. The fact that the names are filtered IS the problem. I don’t want a way to check if a name’s filtered, I need a way to unfilter the names if possible - adding an exemption from the filter for a select few preset names so that instead of saying, for example, “Hello, my name is #### ###” it’d come through as “Hello, my name is John Doe.” Of course, everything not on the very specific list will still be subjected to filters. My game is whitelisted and is made up of mature players so the worry that a younger player would give their real name out doesn’t affect this.
Firestone has a table full of mainly codes & locations in their radio script. This is a whitelist of words, and they won’t be subjected to the filter. Everything else goes through the filter, but the whitelisted words aren’t. This is to avoid important information being tagged - which is exactly what I’m trying to do here, just with roleplay names in chat.
Read my reply again. Whitelisting from the filter is not permitted, especially when input is controlled by a client. This is done illegally and the game can be subjected to moderation action if reported and investigated.
I don’t mean whitelisting players from it, or disabling the filter altogether. I mean there are certain words that don’t break any rules that are picked up by the filter and hashtagged. As far as I can tell, they compile all the words that they need into a table, detect and remove them from the string, run the rest of the message through the filter and put the words back in afterwards. There’s no way for a player to abuse this, swearing etc. is still filtered. It must be permissible because they’ve been doing it for, what, 2+ years?
I’m not talking about whitelisting players or disabling the filter. Read my reply again, for the third time. Doesn’t matter if a word is picked up and tagged. Sanitising any and all client input with the TextService or a ChatService filter method is required, without exemption. Whitelisting is not permitted. Doing so is grounds for moderation action.
Being able to do something for a long time does not automatically equate to permissible. Evading the filter like this has always been illegal. Moderation doesn’t police content and needs probable cause or motive to investigate, which is often achieved by reports. Clearly there haven’t been enough if a game bypassing the filter like this hasn’t been taken down.
That is, provided they are supposedly whitelisting like your posts claim they are. I’m not sure about if thats true or not and that’s no one’s business either; that’s between them and moderation. Doesn’t help your case to bring up another game, worry about yourself.
I think @colbert2677 gave you the only solution, I think it’s best to give him the solution mark and close the thread because like he said, you can not whitelist any name without getting moderated.
I’m bringing up that game because it’s an example of what I want to do. I’ve seen the script myself, I know that’s what they do. It’s a very big game and I’m certain it would have been reported a billion times. Regardless, I’m not here to argue. I was making an example of what I was talking about and this is getting very off-topic. Thank you for your input.
Bypassing the chat filter like this is and always will be grounds for moderation action. If you’re caught doing it then you will have action taken against you.
This thread never really got a proper solution so here you go.
--LOCAL
local replicated = game:GetService("ReplicatedStorage")
local remote = replicated:WaitForChild("RemoteEvent")
local screenGui = script.Parent
local frame = screenGui:WaitForChild("Frame")
local textBox = frame:WaitForChild("TextBox")
textBoxTextChanged = textBox:GetPropertyChangedSignal("Text")
local textButton = frame:WaitForChild("TextButton")
local function onTextBoxTextChanged()
textBox.Text = string.gsub(textBox.Text, "_?(.*)_?", "%1")
textBox.Text = string.gsub(textBox.Text, "[%W_]", "") --Adheres to the characters allowed in usernames on Roblox.
end
local function onTextButtonClicked()
local textLength = string.len(textBox.Text)
if textLength < 3 or textLength > 20 then return end --Adheres to Roblox's username length rules.
remote:FireServer(textBox.Text)
end
textBoxTextChanged:Connect(onTextBoxTextChanged)
textButton.MouseButton1Click:Connect(onTextButtonClicked)
--SERVER
local replicated = game:GetService("ReplicatedStorage")
local remote = replicated.RemoteEvent
local texts = game:GetService("TextService")
local filterString = texts.FilterStringAsync
local function onRemoteFired(player, text)
if not player.Parent then return end
local character = player.Character
if not character then return end
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid then return end
if humanoid.Health <= 0 then return end
local success, result = pcall(filterString, texts, text, player.UserId)
if success then
if result then
local getNonChatStringForBroadcast = result.GetNonChatStringForBroadcastAsync
local success2, result2 = pcall(getNonChatStringForBroadcast, result)
if success2 then
if result2 then
humanoid.DisplayName = result2
end
else
warn(result2)
end
end
else
warn(result)
end
end
remote.OnServerEvent:Connect(onRemoteFired)