Attributes

Learn about the basics of Custom Commands and how to set them up.

Custom Commands can be personalized with Attributes, Some of them are necesary to get your command working

Alias

The Alias is the name that is Displayed on the Command List. If the alias is not configured, The name of the command will be the same as the name registered on the function RegisterCommand().

MyCommand.Alias = "Night Time"

Description

The Description is made to give context of how the command works in a short paragraph, If the description is not configured, No description will be shown.

MyCommand.Description = "Set the Time at 00:00"

Icon

The Icon is the icon displayed on your command as a visual representation of the functionality of your command.

MyCommand.Icon = "rbxassetid://1234567890"

Event

The Event is a Remote Event that will be fired when the command is executed. You will learn how to connect them later.

MyCommand.Event = RemoteEvent

Access

Access allows you to choose which roles on your game can execute a command. If a certain role isn't allowed to execute a command, It won't be visible to them.

You can put {"Team"} to allow every person with access to the panel execute the command.

MyCommand.Access = {"Owner"}

Example

After everything you have done, Your code should look like this.

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

local client = players.LocalPlayer

local storage = replicated_storage:WaitForChild("EXE6_STORAGE")
local events = storage.events

local CustomCommands = require(storage.modules.CustomCommands)

--// REGISTERED CUSTOM COMMANDS

local MyCommand = CustomCommands:RegisterCommand("CC")
MyCommand.Alias = "Custom Command"
MyCommand.Description = "Amazing Description goes here..."
MyCommand.Icon = "rbxassetid://11419714821"
MyCommand.Event = nil --// Replace with event
MyCommand.Access = {"Owner"}

Now, Lets go through parameters and how they work.

Last updated