So I made a script that whenever the player joins and their not an admin then they have a GUI that shows instead but whenever I go to test my script
print'Player Blocker'
local admins = {"ProjectRosploit","AlexTheOtaku","Lisforlucas","Ray5069", "Player", "Player1"}
wait(7)
function tableContains(t, value)
for _, v in pairs(t) do
if v == value then
return true
end
end
return false
end
game.Players.PlayerAdded:connect(function(playa)
if playa and tableContains(admins, playa.Name) then
playa.PlayerGui:FindFirstChild("Main").Block.Visible = false -- line has a error? somehow?
print'Player Allowed!'
playa.PlayerGui.Loading.Visible = true
else
print'Player is not allowed in :('
end
end)
But nothing happens and it says attempt to index a nil value? what does this mean and how do I fix it?

2 comments
It means that it doesn't exist. It's most likely referring to the
.Visibleproperty. Are you sure your hierarchy is correct?yes