How can I make a button only appearing to certain players?

I want to make an admin panel that has a button (To open the admin panel frame) that only appears when a person’s name from the admin table is detected in the game so that only the admins can see it.

I cannot figure out how to do this though and I already tried making a pairs loop and other hard things.

If you think you can help me, please reply.

1 Like

Server script

local admins = {} -- ids
local panel = yourAdminPanelHere -- make sure this can be accessed by the server script

game:GetService("Players").PlayerAdded:Connect(function(p)
if not table.find(admins,p.UserId) then return end
local pgui = p:WaitForChild("PlayerGui")
panel:Clone().Parent = pgui
end)
1 Like