Hello! My game has recently been closed for moderation as we have a naming GUI without a filter, I've been trying to get FilterStringAsync to work but I can only get it working for a custom chat and not for typing names into a gui for a billboardgui. This is the GUI script;
local Detect = script.Parent.FocusLost
Detect:connect(function()
local player1 = game.Players.LocalPlayer
if script.Parent.Text ~= "" then
player1.leaderstats.Character.Value = script.Parent.Parent.PlayerName.Text
player1.Character.Head.BillboardGui.MainFrame.PlayerLabel.Text =(script.Parent.Text)
player1.Character.Head.BillboardGui.MainFrame.PlayerName.Text = player1.Name
end
end)
I've tried using the FilterStringAsync unsuccessfully and need help. I'm struggling and would just like my game back, thankyou

3 comments
Thankyou for explaining the purpose of the function but could you explain how one might implement this in a function for a name Gui instead of just the chat?
For a name GUI, I find it easier to just use FilterStringForBroadcast(http://wiki.roblox.com/index.php?title=API:Class/Chat/FilterStringForBroadcast).
Thanks for your help already, but the wiki is so vague for anyone who has barely used the syntax, I've tried applying these two functions in lots of different ways and this is the closest I could get. It's still not functioning so I'll put one of my attempts up as a different question