I want to create a admin/specific player GUI, so then I can control the game as an admin for testing it. I need to know how to make the GUI button only visible for those specific players, does anyone know how to do this? Or if I even can?
What i reccomend doing is
local Admins = { --This is the table of admins Player; --Change these to the admin names Player; Player; } local event = game:getService("ReplicatedStorage"):FindFirstChild("ToggleAdmin") --Defining Event game.Players.PlayerAdded:Connect(function(plr) --When the player is added it saves them to storage plr.Chatted:Connect(function(msg) --When they chat for index, value in pairs(Admins) do --Loops through admins to see if its them if msg:lower():find(";Admin Commands") then -- If it finds ";Admin Commands" then if plr.Name == value then -- If the players name is equal to the admins name then event:FireClient(plr) -- Fire the client to change if admin is toggled print("Working") --Tells you if its working break -- Ngl i dont know what this does but dont question it end end end end) end)
Make sure you add an Event in replicated storage named "ToggleAdmin"
Now in a localscript in the button or frame, Do
local event = game:getService("ReplicatedStorage"):FindFirstChild("ToggleAdmin") --Define event local frame = script.Parent --Define Button or Button local plr = game.Players.LocalPlayer --Define player event.OnClientEvent:Connect(function() --When admin is toggled function if frame.Visible == false then frame.Visible = true --If the frame isnt visible then it makes it visible else frame.Visible = false --If it IS visible then it disables it end end)
And on the gui or frame put some admin commands with text boxes and scrolling frames I havent tested it. But it should work
Edit: Sorry for how much more complex it is now. Im trying to make sure it works!
Hey there THEBOSS234222!
This is totally possible, and I have done it inside of my own games before. What you want to do is create the GUI like normal, but then insert a script (not local) into the frame (or textbox or whatever is your background part) You will want the script to look something like this:
Let's say you have a ScreenGui > Frame > Textbox. You will want to put the script inside of ScreenGui.
local player = script.Parent.Parent.Parent -- This may be different depending on what your GUI looks like. the first Parent corresponds to the ScreenGui, the second corresponds to the player's PlayerGui, and the third corresponds to the player. (If you don't know what the PlayerGui is, it is the players GUI, and it is a unique part.)
Right after that, you will want to figure out what group of players you want to see the GUI. It could be just a handful of usernames, a rank in a group, if they have a badge, etc.
If you wanted only yourself to see the GUI, your next line would be this:
if player.Name == "THEBOSS234222" then script.Parent.Frame.Visible = true end
I hope this helps! If you have any questions, feel free to ask! :)