> For the complete documentation index, see [llms.txt](https://rocket-networking.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rocket-networking.gitbook.io/docs/server-side-scripting/important-scripts.md).

# Important Scripts

These are the scripts that are allowed to run on your RNet server.&#x20;

<figure><img src="/files/9Ms9wW3hvXaTziN6lQwn" alt=""><figcaption></figcaption></figure>

You have to first add a new game name, that matches the game name in your gamemaker project in Options.gml. By default this was set to "default".

After that you have to ADD NEW SCRIPT and give it a name. There are only particular script names allowed which actually do something on your server. They are

1. "step"   - This code runs every frame of the server in the "game" scope
2. "client\_sent\_event" - This code runs in the server at the "game" scope when some client calls **SentEventToServer()**
3. "game\_server\_created" - This code runs in the server at the "game" scope when the server is first created
4. "room\_created" - This code runs in the server at the  "room" scope whenever a new room is created ie when a client joins a room that did not exist before or when you add a persistent object to a room which did not exist before
5. "client\_created" - This code runs in the server at the "client" scope whenever a new client is created ie whenever a new client calls **ConnectToServer()**
6. "entity\_created" -  This code runs in the server at the "entity" scope whenever a new entity is created by a client
7. "persistent\_object\_created" - This code runs in the server at the "persistent object" scope whenever a new persistent object is created

You can make more scripts with other names, but they won't actually do anything in your game. Please back up all your code!!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://rocket-networking.gitbook.io/docs/server-side-scripting/important-scripts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
