I am currently trying to make a Command Box using Basic Admin Essentials. This command box should have a text box to input your command, then a text button titled ‘Execute’ to execute the command. Right now, I am able to have the command create the box, but it cannot execute a command.
Does anyone know how I would be able to have the command execute using the button? Remember, this is through basic admin essentials.
You could it have so when you press on the button, it stores the text in the textbox as a variable, and then splits it using string.split(" "), which will split all the text separated by a space into a table, from there, you can check what the command was by checking the first index of the split table and checking the usage of the command by the other arguments
How could I make it execute a basic admin command though? The command that they are putting into the box is a command part of basic admin. I am not sure how to make that command go.
That I’m unsure of, that depends on where you stored your commands, but the method I used should give a basic idea of how you could do a system like that.
If it’s a module, then can’t you require that module and compare the table of Commands inside of there and fidn the right command? Or that not possible with how it is set up?
I’m not sure how to do that or what I would need to do. Do you think you could take a look at the model and see what I am seeing? You can put my script in and play around.
I’ve used Basic Admin multiple times before, and I think making a button to open the command bar would be way easier; just take a look at the Console part of the Module and I think you would figure it out.
So I’ve made something similar where if you press the button the command bar shows up, what you need to do is make a GUI (I made a script to destroy it if there is a LR rank who’s not suppose to use the command but you don’t have to, since the basic admin rank still applies).
After you’ve done that, you don’t go to the main module, instead you go to the essential code script inside of the components which is inside the script, now you might’ve already notice it’s a client script, so you define the local player:
Local Plr = game.Players.LocalPlayer
And then define the button:
Local Button = Plr.PlayerGui.<where you put it>
After you’ve done that make a function detecting when the button is pressed:
Button.MouseButton1Click:Connect(function()
end)
There is already a function build in, which is the console function, call that function when button is pressed, so your code should look something like this:
Local Button = Plr.PlayerGui.MainUI.Console
Button.MouseButton1Click:Connect(function()
Console()
end)