I'm trying to make a script when a player joins the game it would check if the player is an admin or not. The problem is that I put my name inside the admin table and it would still print out that I am not an admin (false). I do not know what is wrong with the code. If anyone could help it would be appreciated.
Script
local admins = {"jatytech", "Player1", "Player2", "Player3"}
local isAdmin = false
game.Players.PlayerAdded:Connect(function(player)
for i,v in pairs(admins) do
if player.Name == v then
isAdmin = true
break
elseif player.Name ~= v then
isAdmin = false
end
end
end)
print(isAdmin)
