ID:146623
 
I don't know how to make it so that certain words in a list cannot be in someones name. Please help

var/Name = input("What's ya name ya bum?!","Name Selection") as text|null
var/list/Badwords = list("n00b")
var/list/WordsFount = list()
for(var/W in Badwords)
if(findtext(Name,W))
WordsFount+=W

if(WordsFount.len)
var/Message = ""
for(var/W in WordsFount)
Message += " \[[W]]"
Message = "You can't have[Message] in your name."
src << Message
return
else
src << "Good job >.>"


Note the use of findtext(). You can build from there.

-Ryan