You made no actual attempt to check for the value inside of the table.
Essentially, you are comparing a string to a table by doing player.Name == banned. You are not comparing any values of the table to the name of the player. Since the table you have is an array, these values have numeric indices (1 and 2, respectively, since Lua is insane).
This also means you can use a numeric for loop using the length operator, #:
for i = 1, #banned do
end
And because you can use a numeric for loop, you can refer to these values using numeric indices, such as banned[1], which would refer to CodeWon.
For searching through a table, I would not use table.find(). I understand Roblox makes things easier for their developers, but the more you grow accustomed to using for loops, the better you will get at using them for iterating, especially for times when you actually need to iterate. Plus, table.find() literally uses a for loop anyway. I don't see a valid point in using this function unless you want to stain yourself and not know how to iterate through tables.
My other option for you is a generic for loop:
for iteration, value in pairs(banned) do
end
value will automatically refer to the value it hits upon iterating through the given set of data returned by pairs(). This means you can just do player.Name == value rather than doing player.Name == banned[i], which is somewhat easier.
1 comment
i suck at tables but i think you need to do something like table.find or something like that