Hello, I’m trying to censor messages however it doesnt work
here is my script
local gui = plr.PlayerGui.OtherUi.EmpireData.TextBox
local sucess,failure = pcall(function()
GloriousEmpire = TextService:FilterStringAsync(gui:GetNonChatStringForBroadcastAsync(), plr.UserId)
end)
if not sucess then
print(failure)
GloriousEmpire = ""
end
it outputs
GetNonChatStringForBroadcastAsync is not a valid member of TextBox "Players.KrimsonWoIf.PlayerGui.OtherUi.EmpireData.TextBox"
local message = "hello, I like to gamble at casinos"
local textService = game:GetService("TextService")
local CensoredMessage = TextService:FilterStringAsync(message)
-- code here to do something with message so it censors with ### and stuff
print(CensoredMessage)
however it lets me say some pretty terrible things and it does not censor any of it
(also now realising that gui.Text will not change on the server lmao)
local gui = plr.PlayerGui.OtherUi.EmpireData.TextBox
local sucess,failure = pcall(function()
GloriousEmpire = TextService:FilterStringAsync(gui.Text, plr.UserId)
end)
if not sucess then
print(failure)
GloriousEmpire = ""
end