This is the table (changed their name just for the question as they didnt want their roblox names shown)
local Access = {"a","b","c","d","e"}
this is the for loop which kicks me before it gets to my name in the table
game.Players.PlayerAdded:Connect(function(plr) for i, AdminName in ipairs(Access) do if plr.Name ~= AdminName then plr:Kick("You're not whitelisted, mate.") else break end end end)
is there a method to stop it from kicking me before the loops gets to my name?
Make a variable and check if the player's name is found in the Access
table. If the player's name is found in there, change the variable's value to true, else don't change it.
If the variable is true, then don't kick them, else, you'll kick them.
game.Players.PlayerAdded:Connect(function(plr) local found = false for _, AdminName in pairs(Access) do if plr.Name == AdminName then found = true end end if not found then player:Kick("You're not whitelisted, mate.") end end)