Nothing is calling the first scripts code. Try this:
local UI = script.Parent --Shorten things a bit
local bannedPhrases = {"@everyone", "@here"} --A table for all the banned phrases
UI.Changed:connect(function() --When the UI changes
for _,v in pairs(bannedPhrases) do --Go through every item in the banned phrases table
if string.find(UI.Text, v) then --If the UI's text contains that phrase
UI.Text = "Invalid Phrase" --Change it
end
end
end)
Ultimately, you can anything you want on the line that changes the UI.Text, for example kicking the player. Just going off what you had for now
If you make it local bannedPhrases = {“@”} it should work, however let it be known that it essentially makes it so that users can never use the @ symbol. Therefore users cannot type things such as:
“Meet me @ 2”