Exe 6
  • What's Exe 6?
  • Get Started
    • Purchasing
  • Installation
  • Authentication
  • Roles
  • Configuration
  • Custom Commands
    • Getting Started
    • Attributes
    • Parameters
      • Player Parameter
      • Slider Parameter
      • Text Box parameter
      • Boolean Parameter
      • Enum Parameter
    • Receiving Events
    • Demostration
  • APPS
    • Introduction to Apps
    • Prepare
    • Publish
    • Submit
    • Update
    • App Guidelines
Powered by GitBook
On this page
  1. Custom Commands

Receiving Events

Now that we went through all the parameters, We need to execute an action with all of these parameters. Your code should look like this after registering the parameters.

local MyCommand = CustomCommands:RegisterCommand("CC")
MyCommand.Alias = "Custom Command"
MyCommand.Description = "Amazing Description goes here..."
MyCommand.Icon = "rbxassetid://11419714821"
MyCommand.Event = MyEvent

MyCommand:AddParameter("Player", {
	Name = "Amazing Player", --// Parameter name.
	SelectionRange = NumberRange.new(1, 1), --// Minimum & Maximum selection of players.
})

MyCommand:AddParameter("Slider", {
	Name = "Amazing Slider", --// Parameter name.

	SliderDefault = 50, --// Default value when the slider is opened.
	SliderIncrement = 10, --// Increment between the values.
	SliderRange = NumberRange.new(0, 100), --// Minimum value & Maximum value.
})

MyCommand:AddParameter("Textbox", {
	Name = "Amazing Text Box", --// Parameter name.
})

MyCommand:AddParameter("Boolean", {
	Name = "Amazing Boolean", --// Parameter name.
})

MyCommand:AddParameter("Enum", {
	Name = "Amazing Enum", --// Parameter name.
	Items = game.Workspace:GetChildren(), --// Table of items in the list.
	SelectionRange = NumberRange.new(1, 5) --// Minimum & Maximum of items you can select.
})

With this ready, We will use the event we assigned into the attribute MyCommand.OnServerEvent, Check this example

MyEvent.OnServerEvent:Connect(function(moderator, data)
    print(data)
end)

With that done, Our data should return our parameters and their response, Like this.

{
    ["Amazing Boolean"] = false,
    ["Amazing Enum"] = {},
    ["Amazing Player"] = {},
    ["Amazing Slider"] = 50,
    ["Amazing Text Box"] = ""
  }
PreviousEnum ParameterNextDemostration

Last updated 1 month ago