I know how to filter through a tables contents with a loop BUT I am trying to figure out how I will do something like make a WhiteList
What i wanted to do was Destroy a script completely if the user's name wasn't on the WhiteList so therefore they wouldn't be able to use it
This is what i've done so far
local player = game.Players.LocalPlayer
local WhiteList = {player, user, names, here}
for i,v in pairs(WhiteList) do
if player.Name == v then
print('granted')
elseif player.Name ~= v then
script:Destroy()
end
end
This works but it destroys the script even though it hasn't seen if the players name matches any of the other items in the script. How do i make it do it only after it's finished checking, and if it gets a match, it'll keep the script?

1 comment
Telling the script to kill itself. How cruel.