# Commands

Commands are part of the client, and easy to create. There are currently 7 built-in commands in the system that work effectively.

#### Example (/console)

```lua
-- Author: @Jumpathy
-- Name: developerConsole.lua
-- Description: Ability to open developer console via /console

local starterGui = game:GetService("StarterGui")
local command = {}
command.name = "console"
command.aliases = {"c"}
command.call = function()
    local devConsoleVisible = game.StarterGui:GetCore("DevConsoleVisible")
    game:GetService("StarterGui"):SetCore("DevConsoleVisible",not devConsoleVisible)
end
return command
```

### Creating our own

Let's get started on creating our own command that resets the player!

1. Add a module and name it whatever you want in the 'Commands' folder.![](/files/MrD2mcLXpItinODw5c6Y)
2. Open it and set something like the following code:

```lua
local command = {}
command.name = ... --> Command name
command.aliases = {} --> Command aliases
command.call = function(text) 
	-- Function called when command is run
end
return command
```

3\. Name it whatever you want and then for the function to kill the player it'd go:

```lua
game:GetService("Players").LocalPlayer.Character:BreakJoints()
```

4\. That's it! You now have a command named whatever you set it to and when you type it, it'll reset your character. Go crazy!

#### Working code:

```lua
local command = {}
command.name = "reset"
command.aliases = {"die"}
command.call = function(text) 
   game:GetService("Players").LocalPlayer.Character:BreakJoints()
end
return command
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jumpathy.gitbook.io/betterchat-v3/client/commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
