> For the complete documentation index, see [llms.txt](https://akequ.gitbook.io/scp-classified-site-plugin-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://akequ.gitbook.io/scp-classified-site-plugin-api/docs/creating-new-room-event.md).

# 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)
