# Creating New Room Event

{% hint style="warning" %}
All Room Event classes must be placed under namespace **Plugin.Rooms**
{% endhint %}

### Class Functions

* Init() - <mark style="color:green;">\[OPTIONAL]</mark> class initialization.
* Update() - <mark style="color:green;">\[OPTIONAL]</mark> called every frame.

### Local Properties

* netEvent - return NetworkedEvent class.&#x20;

### Local Functions

* SendToEveryone(string FunctionName, params object\[] arguments) - send command to every player to call function with arguments.
* SendToClient(string FunctionName, NetworkConnection connection, params object\[] arguments) - send command to player with connection to call function with arguments.
* SendToServer(string FunctionName, params object\[] arguments) - send command to server to call function with arguments.
* Invoke(Function, float seconds) - same logic as UnityEngine.Object.Invoke, call function after time.

### Example

```csharp
using UnityEngine;

namespace Plugin.Rooms
{
    public class HC_HID : Akequ.Base.Room
    {
        public override void Init()
        {
            if (netEvent.isServer)
            {
                Door door = DoorManager.SpawnDoor(1, Vector3.zero, Quaternion.identity);
                door.transform.parent = netEvent.transform;
                door.transform.localPosition = new Vector3(-2.8809f, 0f, -7.68036175f);
                door.transform.localRotation = Quaternion.Euler(0, 90, 0);
                door = DoorManager.SpawnDoor(1, Vector3.zero, Quaternion.identity);
                door.transform.parent = netEvent.transform;
                door.transform.localPosition = new Vector3(-2.8809f, 0f, 7.68036175f);
                door.transform.localRotation = Quaternion.Euler(0, 90, 0);
                door = DoorManager.SpawnDoor(0, Vector3.zero, Quaternion.identity);
                door.transform.parent = netEvent.transform;
                door.transform.localPosition = new Vector3(-7.758f, 0f, 0f);
                door.transform.localRotation = Quaternion.Euler(0, 90, 0);
                door.keyData = new KeyData() { armory = 3 };

                ItemPickup obj = ResourcesManager.SpawnItem("MicroHID");
                obj.transform.parent = netEvent.transform;
                obj.transform.localPosition = new Vector3(-9.41675186f, 1.71533203f, 4.32899475f);
                obj.transform.localRotation = Quaternion.Euler(0, 270f, 0);
            }
        }
    }
}
```

Example Solution can be downloaded here:\
[Link to archive](https://drive.google.com/file/d/1SLHd8pJSxtifZEVIpuRRt1-uVN1st1h1/view?usp=sharing)


---

# 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://akequ.gitbook.io/scp-classified-site-plugin-api/docs/creating-new-room-event.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.
