Product: exe | Learn How to Create Custom Commands!

Introduction.

Custom Command is one of the best features of Product: exe. You can create different types of commands that do different things like setting the time to dawn, clearing your friend’s accessories, or making the server go blind by making the environment as bright as white.

Currently, you can choose and combine between these types of what we call “Procedures”;

Plain

The Plain is the most basic procedure out of all. It doesn’t require anything other than just a click of the execute button.

Input

The Input also known as the Textbox procedure lets you type. There are 3 types of this procedure; none, number, and string. “none” lets you type either numerical or non-numerical characters, “number”, lets you type numerical characters, and “string” lets you type non-numerical characters.

Player

The Player procedure lets you choose a player for your command.

Slider

The Slider procedure lets you set a minimum and maximum value. You can also configure the increment and the default value.

So now you know the different types of procedures. You can choose and combine procedures to fit your liking. (Plain Procedure isn’t combinable.)


@Cookie_DevX’s Video Tutorial.

You can proceed to 16:54 timestamp for a step-by-step guide to creating custom commands.


Tutorial.

After setting up Product: exe, you can now go ahead and create custom commands. Go to ReplicatedStorage and proceed to exe_storage inside it, you will find the folder named custom_commands. This is the place where you first set up your custom commands.

Still not done setting it up?

Inside the folder, you will find more folders. These are the premade commands.

image

To create a new one, duplicate one of the folders. Make sure you give it a unique name to differentiate between commands.

Let’s create a command where I can edit the player’s cash value. I’m going to name it “Cash Value Changer”.

Opening your command folder will reveal more properties. These properties are necessary to fill out, keep that in mind.

Properties Description
command_description The description of your command.
command_icon The image of your command.
command_name The name of your command.
event The trigger event of your command.
procedure The settings of your command.

The event can either be RemoteEvent, or BindableEvent. The event is an ObjectValue, so you need to link it to your desired event. This event will be fired if the command is executed.

Looking at the attributes of the procedure object will reveal way more properties needed to fill out depending on how your command functions.

Since we’re making a cash value changer command, I decided to use the Input and combine it with the Player procedure. I also set the input_settings to “number” just because we don’t need anything else other than just numbers.

Let’s make sure that we did it the correct way;

Status Actions
:white_check_mark: Fill out the command Name, Description, and Icon.
:white_check_mark: Link the Event meant for triggering.
:white_check_mark: Set up the Procedure.
:x: Script the Command.

The table says that we’re on the right track, let’s keep going! Let’s now proceed to the Scripting.

If the event you linked to the event property is RemoteEvent then you need to access it from the server, so you can only use the Script object. However, if the event you linked is BindableEvent then you need to access it from the client, so you can only use LocalScript.

You may wonder where is the script for all of the premade custom commands, it’s right here;

image

The script is named custom_command_handler. You have the option to put your script right there if your command runs on the server but, if your command runs on the client you must create a new LocalScript. Again, you can create your own Script or LocalScript depending on your command.

In this tutorial, we will create a new Script. Since Changing Cash Value is going to be handled on the server, we’ll use Script.

image

I just created a script and let’s head inside it.

local players = game:GetService("Players")
local replicated_storage = game:GetService("ReplicatedStorage")

local cash_event = replicated_storage.RemoteEvent --the RemoteEvent I linked to the event property

I created a few variables related to our command.

local players = game:GetService("Players")
local replicated_storage = game:GetService("ReplicatedStorage")

local cash_event = replicated_storage.RemoteEvent

cash_event.OnServerEvent:Connect(function(player, recipient, value) --this means the command is executed
	local cash_value = recipient.leaderstats.Cash
	
	cash_value.Value = value
end)

We’re done with the script now! The command should now be listed and executable
in-game.

Player, Input, Slider procedure has returns that you need to acknowledge;

cash_event.OnServerEvent:Connect(function(player, recipient, value)

Those are the recipient and value. Since we used the Player and Input procedure, if the command is executed then it will return the Chosen Player and the Text in the Textbox.

Why didn’t you acknowledge the player?

→ If you used RemoteEvent there’s a default return of the player object. This object refers to the player who executed the command. There’s no return of the player object in BindableEvent.

If you combine procedures, think of this priority list;

Priority Procedure
1 Player Procedure (recipient)
2 Input Procedure (value)
3 Slider Procedure (slider)

The list tells us what returns first and what returns last. So if we take that list into scripting (example)

example_event.OnServerEvent:Connect(function(player, recipient, value, slider)

You can see how I arranged the returns. I put the recipient first and put the slider last because the priority tells us that the slider is the last one to return.

This priority list is important. Always keep this in mind when scripting your command. Not doing so, will lead to error.

We are done! Try it now, your command should look like this in-game.


Slider Procedure Highlights.

We glanced over the Slider procedure but, we haven’t touched it yet. Let me explain to you how it works.

There’s a premade command called “Brightness Setting”, which allows you to set the brightness of the environment.

Looking at its command folder;

This command uses the slider procedure and it’s pretty cool to play with!

These are the properties that it has. Here is the explanation of every slider configuration in there;

Property Description
slider_default The default value of the slider.
slider_increment The number difference every slide.
slider_settings The minimum and maximum value.

The slider increment is very useful, it serves as one of the calculations of possible values a slider can have.

So the maximum value is 10, divide it by 0.1;

10 / 0.1 = 100 possible values

There are 100 possible values that a slider can offer in this command, that’s a lot!

The command should look like this;

The slider also shows the minimum value and the current value of the slider.


You reached the end! Hopefully, you can now create your custom commands!

Do you have other questions? Contact us!


7 Likes