✓ Accepted answer
This is a simple example. There are probably more sophisticated ways but here you go. I use string.find(string, searchString). string is the name and searchString is the banned word. You'll have to do the fine tuning yourself.
local BannedWords = {"Naruto", "Bob Ross"}
local function CreateName(nameChangedTo)
local isBadName = false
for _,banned in pairs(BannedWords) do
if string.find(nameChangedTo:lower(), banned:lower()) then
isBadName = true
end
end
if not isBadName then
print("Yep, name is good to go")
else
print("Nope, bad name!")
end
end
CreateName("Naruto Who?")
CreateName("Bob Ross Who?")
CreateName("naruto")
CreateName("NNarutoooooo")
CreateName("Bob Rose")
CreateName("Bobby Rossu")
1 comment
http://wiki.roblox.com/index.php?title=Text_Filtering