# llExecCharacterCmd

*LSL function*

```lsl
void llExecCharacterCmd(integer command, list options);
```

- `integer command`: Pathfinding command to execute.
- `list options`: A list of options for the command (e.g., jump height for CHARACTER_CMD_JUMP).

- Energy: 10

Sends a command (specified by command) to the pathing system with options. Currently only supports stopping pathfinding or making the character jump.

Send a command to the pathing system.

Currently only supports stopping the current pathfinding operation or causing the character to jump.

```lsl title="How to use" frame="terminal"
llExecCharacterCmd(0, []);
```

## Specification

- float — **height** — height to jump, between 0.1m and 2.0m

<table>
	<tr>
		<th>Command</th>
		<th>Value</th>
		<th>Description & Required Parameters</th>
	</tr>
	<tr>
		<td>[CHARACTER_CMD_JUMP](/constants/CHARACTER_CMD_JUMP/)</td>
		<td>0x1</td>
		<td>

			Makes the character jump.

			The **option** list is required to start with a **height** parameter: \[[float](https://wiki.secondlife.com/wiki/float) **height**\]

			<table>
			</table>

		</td>
	</tr>
	<tr>
		<td>[CHARACTER_CMD_SMOOTH_STOP](/constants/CHARACTER_CMD_SMOOTH_STOP/)</td>
		<td>0x2</td>
		<td>Stops any current pathfinding operation in a smooth like fashion.</td>
	</tr>
	<tr>
		<td>[CHARACTER_CMD_STOP](/constants/CHARACTER_CMD_STOP/)</td>
		<td>0x0</td>
		<td>Stops any current pathfinding operation.</td>
	</tr>
</table>

## Caveats

- If another script in the same object issues [CHARACTER_CMD_STOP](/constants/CHARACTER_CMD_STOP/) then pathing in all scripts is cancelled.

## Examples

<details open>
<summary>Example 1</summary>

```lsl collapse={1-30}
vector patrol;

default
{
    state_entry()
    {
        patrol = llGetPos();
        llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
        state awake;
    }
}

state awake
{
    state_entry()
    {
        llSay(0, "I am guarding now");
        list points = [patrol + <5,0,0>, patrol - <5,0,0>];
        llPatrolPoints(points, []);
    }

    touch_start(integer total_number)
    {
        state sleep;
    }
}

state sleep
{
    state_entry()
    {
        llSay(0, "Going to sleep");
        llExecCharacterCmd(CHARACTER_CMD_SMOOTH_STOP, []);
    }

    touch_start(integer total_number)
    {
        patrol = llGetPos();
        //Jump to attention!
        llExecCharacterCmd(CHARACTER_CMD_JUMP, [0.5]);
        state awake;
    }
}
```

</details>

## History

Date of Release [31/07/2012](https://wiki.secondlife.com/wiki/Release_Notes/Second_Life_Server/12#12-07-31-262785)

## See also

### Functions

- [llCreateCharacter](/functions/llCreateCharacter/)
- [llDeleteCharacter](/functions/llDeleteCharacter/)
- [llEvade](/functions/llEvade/)
- [llExecCharacterCmd](/functions/llExecCharacterCmd/)
- [llGetClosestNavPoint](/functions/llGetClosestNavPoint/)
- [llFleeFrom](/functions/llFleeFrom/)
- [llNavigateTo](/functions/llNavigateTo/)
- [llPatrolPoints](/functions/llPatrolPoints/)
- [llPursue](/functions/llPursue/)
- [llUpdateCharacter](/functions/llUpdateCharacter/)
- [llWanderWithin](/functions/llWanderWithin/)

### Events

- [path_update](/events/path_update/)

---

*Source: [LlExecCharacterCmd](https://wiki.secondlife.com/wiki/LlExecCharacterCmd) on the Second Life Wiki. Content from the Second Life Wiki articles LlExecCharacterCmd (revision 1194127, 2015-01-22) and Template:LSL Constants/ExecCharacterCmd (revision 1215205, 2023-10-28), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llExecCharacterCmd/
