making a simple ip banlist

So basically I have this code:


BannedIPs = {
	"00.00.00.00" --Example IP Ban
}
hook.Add("PlayerInitialSpawn", "CheckBannedIPs", function(ply)
	if (string.find(ply:IPAddress(), BannedIPs, 1, true)) then
		local id = ply:SteamID();
		RunConsoleCommand("ulx", "banid", id, 0, "[IP Blacklisted]");
	end
end)

But I get this error:


143: bad argument #2 to 'find' (string expected, got table)

how would i fix this?

You should use table.HasValue instead of string.find - the error is quite clear as to what the problem is

:facepalm:

thanks.