I wanna make a script that in a textbox detects a string then will replace it with something else then immediately submit it afterwords, in other words as in submit like if you are chatting then you press enter it submits the chat. I know I could use the chat RemoteEvent but I want to use this on all gui's not just chat.
local blacklist = {
'badword',
'badword2',
}
local RunService = game:GetService("RunService")
local plr = game.Players.LocalPlayer
local pgui = plr.PlayerGui
RunService.RenderStepped:Connect(function()
for i,v in pairs(pgui:GetDescendants()) do
if v.ClassName == 'TextBox' or v.ClassName == 'TextLabel' or v.ClassName == 'TextButton' then
for b,n in pairs(blacklist) do
if string.find(v.Text,n) then
v.Text = "#&*^(@"
-- Not sure what to put here
end
end
end
end
end)

6 comments
What's happening at the moment?
What do you mean?
Try using TextBox.TextEditable = false
Nope didn't work.
mmm i'm waiting for you to look at my answer..
not what im looking for.