Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How would you make it so only specific people/a specific person see(s) a GUI?

Asked by
1ov3y0u 51
5 years ago

I'd like to know how to make it so only a specific person sees a GUI. I think I have it, but I haven't tested it yet. It's for a game I'm currently making, for an admin panel. If anyone could help, thanks!

2 answers

Log in to vote
0
Answered by 5 years ago

Wrote you a little code block to help. It's a serverscript, put it in ServerScriptService and put the Gui inside it. Then put the following code in. YOU MUST DISABLE RESETONRESPAWN ON THE GUI

local whitelist = {
    "MachoPiggies:MyUserId", --// Example
}

game.Players.PlayerAdded:Connect(function(plr)
    for i,v in pairs(whitelist) do
        if v:lower() == tostring(plr.Name:lower()..":"..plr.UserId) then
            local UI = script:FindFirstChildOfClass("ScreenGui"):Clone()
            UI.Parent = plr.PlayerGui
        end
    end
end)
0
Thank you! 1ov3y0u 51 — 5y
Ad
Log in to vote
1
Answered by
SmartNode 383 Moderation Voter
5 years ago

Easiest way is probably disable the visibility of the UI, add a local script and if the user is whitelisted to have the ui, enable the visibility, of not then delete the UI itself.

Answer this question