So, I'm making a city with my Friends and obviously your gonna need an Admin Gui but its an Insert. Anyways How do I make it so only Me and a Few others can see it? It would make my Day/Few days if I could figure it out. Thanks! P.S. The Gui is a button that Pop ups another Frame.
How do it Make only a Few people seeing a Gui?
1 answer
In my opinion the easiest way to do this is to have a script inside of the GUI that has the button (if it's the only thing in there, if it's not put the script in the button), the code would look something along the lines of the code below. It will essentially go through the table and check the name of the player joining and if it's you or one of your friends it will keep it, otherwise it will destroy the gui.
local access = {"iixPhantxmNick_dxv", "otherFriend"};
function isAdmin(name)
for _, plr in pairs(access) do
if name == plr then
return true;
end;
end;
return false;
end;
game.Players.PlayerAdded:connect(function(plr)
if isAdmin then
return;
end;
script.Parent:Destroy();
end);
There are probably simpler, more efficient ways to do this, but this is what I use. If this helped, please accept this as the answer so that other people know you've been helped and if they have the question themselves, they can find the answer here. If you have any more questions feel free to ask.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Could you explain some more?