# On-Join Commands

Create dynamic scenarios by executing custom commands after fake players join. These interactions add depth and excitement, making your server more captivating than ever.

{% code overflow="wrap" fullWidth="false" %}

```yaml
  on_join_commands:
    delay: 5
    commands:
      - '50:eco give %player% {random[1000,10000,100]}' # Has a 50% chance to give the player a random amount of money between 1000 and 10000 that is divisible by 100
      - '80:eco give %player% {random[100,9000]}'
      - '10:eco give %player% {random[10000,100000,5]}'
```

{% endcode %}

* Commands to be executed when a player joins, with specified chances, random values and a delay

#### Custom Messages&#x20;

* You can use the following at the beginning of ":" sudo! ; chat!
* sudo! -> makes the fake player execute a command on join eg: "50:sudo!register (your authentication plugin command)"
* chat! -> makes the fake player say something when he joins eg: "50:chat!sup everyone!"

#### Custom Chances&#x20;

* Normally, the commands are executed weight randomly based (for more accurate results)
* You can use -999 instead of a normal number to execute a command URGENTLY that doesn't take into account the delay eg: "-999:sudo!login (password)"


---

# 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://docs.spoof.dev/asteroid/setup/features/on-join-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.
