Textbox filtering not working

Im trying to make a name system but when you unfocus on the text or click enter, it does nothing and errors as this
image

local textBox = script.Parent
local textService = game:GetService(“TextService”)
local UserIn

textBox.FocusLost:Connect(function()
textService:FilterStringAsync(textBox.Text)
end)

I changed the code to this but it still doesn’t work


It says must only be called by server scripts but I want it to filter it locally

Well you could:
1.Filter the string in a serverscript
2.Use a remote/bindable event that fires to the server, after the .FocusLost event was triggered, to get the filtered string
3.Now your string is filtered, you can do whatever you want with it in your local script

1 Like

Try this topic on Roblox Documentation.

Tysm! It worked!!!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.