Well, I was creating an Admin Panel that would be allocated in Replicated Storage and with a Script I would Clone it for the PlayerGui.
At first I thought everything was working, but when the player resets, the GUI does not appear again.
I was thinking of putting the GUI on the StarterGui, making it Visible and Enabling the Script for whoever is on the list, but I don’t know how safe it can be, what do you think about it? I also thought about using a loop to check if the player on the list has the GUI, and Clone it if not, but maybe there is a better option. I tried to research a little, but I don’t know exactly how I should research to find something that would help me in this case.
Here’s the Script I’m using to filter the players and give the GUI:
local isAdmin = {
["Player1"] = true,
["Player2"] = true
}
game.Players.PlayerAdded:Connect(function(player)
if isAdmin[player.Name] then
local AP = game.ReplicatedStorage.UIs.AdminPanel:Clone()
AP.Parent = player.PlayerGui
AP.Enabled = true
AP["ap_open"].Disabled = false
end
end)
Thank you in advance for your attention.