Change name isn't filtering

I want it so no inappropriate names can be made. The filter isn’t tagging the inappropriate words, so the name can be any bad word. Does anyone know why it isn’t filtering?

local remoteEvent = game.ReplicatedStorage.NameChangeEvent
remoteEvent.OnServerEvent:Connect(function(plr, name)
	
	local char = plr.Character or plr.CharacterAdded:Wait()
	
	local filteredName = game:GetService("TextService"):FilterStringAsync(name, plr.UserId)
	
	local filteredNameAsString = filteredName:GetNonChatStringForBroadcastAsync()
	
	local nameGui = char.Head:FindFirstChild("NameGui")
	
	local namelabel = nameGui:FindFirstChild("NameLabel")
	
	namelabel.Text = filteredNameAsString
	
end)

Are you testing it in roblox studio or roblox game client? filter does not work in studio.

1 Like

You can filter word using TextService

local TextService = game:GetService("TextService")
local filteredTextResult = TextService:FilterStringAsync(text, fromPlayerId)

You can read more here and make sure you can it on the server.

a test it in studio how you test it in game client?

Go to the roblox website and press play in the game.

Hello, sorry for that. I haven’t read your script but it may helpful for someone. I just did a research and find out that Filtering don’t work in Studio. You should go in real game to have the best result. More information go here.

How do a make it so i can only join the game am very new and i never put a done something like this, it doesn’t give the options too when am on config.

Did you publish the game? If so, check that privacy is set to private so that only people who have access to edit the game can join.

1 Like

it found out how to join it works so i was not being smart thanks for the help to find out how to see if it really works.

2 Likes