You have many sensible mistakes, but no worries. I got your back.
game.Players.PlayerAdded:connect(function(plr)
Admins = {"user", "user", "user"}
for i,values in pairs(admin) do
if plr.Name == values then
script.Parent.Parent.Visible = false
end
end
end)
This is untested, if there is an error, please look in the output and let me know about it.
If you care to read, I'll explain what the code does.
The first line says that when the player enters the game the code inside of it is executed.
The second line is essential and will define any users that should be admin.
The fourth line defines the table's values individually inside of a if loop so that it is ran by the number of values the variable, Admins contains.
The sixth line simply turns the object invisible.
1 comment
I would actually recommend putting the gui in ServerStorage, and cloning it to PlayerGui. Exploiters can easily turn it on