Hello! I am seeking a script that enables my staff to access the Basic Admin Essentials 2.0 command bar through a UI button located at the top of their screens. This feature is particularly important for my staff that use mobile devices or those who struggle to open the UI using the standard command. I’ve spent countless hours searching through forums looking for a solution, and just when I thought I found one, the information was unclear and left me more confused than before.
If you believe you can assist me, I would greatly appreciate it! Thank you in advance.
Editor’s Note: I’m relatively new to Roblox scripting, but I’m dedicated to learning and improving every day! If you believe you can assist me, please reach out to me on Discord. My username is sleepy.lunar.
Make the UI button initially hidden at first. Add a table in which the UIDs (user ID’s) of staff are written, make a PlayerAdded function that checks if the players UID matches staff UID’s, then if it does, then make it so that the UI button is visible for the staff only (youd have to use Remote Events for this, id recommend looking it up on documentation)
(rushed, thats why no example codes given)
For the maximum security, you can have this structure:
ScreenGui containing command bar (likely a TextBox within it)
LocalScript to send the command to the server for processing
RemoteEvent inside the ScreenGui to communicate between the client and server
Place this GUI in ServerStorage.
Server script:
--example
local players = game:GetService("Players")
local gui = --path to your gui
local admins = {} --insert admin UserIds
local connections = {} --store admin remote connections
local function onPlayerAdded(player: Player)
if not table.find(admins, player.UserId) then return nil end
--clone the gui and parent to their player gui here
local remote = --the path to the remote inside of the cloned gui
connections[player.Name] = remote.OnServerEvent:Connect(function(sender: Player, ...: any)
if sender ~= player then
--an exploiter fired the remote! Do what you will here.
end
local cmdData = {...} --gather the extra command data
--cmdData will now hold the data for the command
--process the command here!
end)
end
local function onPlayerRemoving(player: Player)
if table.find(admins, player.UserId) then connections[player.Name]:Disconnect() end
end
players.PlayerAdded:Connect(onPlayerAdded)
players.PlayerRemoving:Connect(onPlayerRemoving)
This is brief server-sided logic. Please let me know if you have any questions!
edit: didn’t know it was a community resource sorry