You've misunderstood tables a little bit.
The # means "length." So, #a is just going to be 3. With that in mind, your read reads:
player = game.Players.LocalPlayer
a = {36491121, 57099125, 60788697}
if player.userId == 3 then
script.Parent.Parent:Destroy()
end
Naturally you aren't trying to check whether their player ID is 3. So here's what you can do instead: iterate through the table.
Start with setup:
player = game.Players.LocalPlayer
a = {36491121, 57099125, 60788697}
Next, we need some way to tell whether they are in the list.
areTheyInTheList = false
It starts false, because we haven't found them in the list yet.
Now, we will look through the list:
for i = 1, #a do
What this means is that i will first be 1, then be 2, then be 3, and stop at that point, since #a = 3.
Inside this list, we need to look at a[i] and check it. So:
if a[i] == player.userId then
areTheyInTheList = true
end
Once we find it, we set it to true. Then, end the loop:
end
And now we act on it:
if areTheyInTheList then
player:Kick()
end
All together, our script is:
player = game.Players.LocalPlayer
a = {36491121, 57099125, 60788697}
areTheyInTheList = false
for i = 1, #a do
if a[i] == player.userId then
areTheyInTheList = true
end
end
if areTheyInTheList then
player:Kick()
end
1 comment
Modified it for you.