> 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/rocket-networking-code/persistent-objects/createpersistentobject-roomid-persistentobjectstruct.md).

# CreatePersistentObject(roomId ,  persistentObjectStruct)

## Description

This function creates a new persistent object in your server in the room you specified. It takes on the properties you list in the persistentObjectStruct as key value pairs

#### Syntax

```
CreatePersistentObject(roomId,persistentObjectStruct);
```

| Argument                 | Description                                                                                                                          |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| `roomId`                 | <p>The name of the room where this new persistent object will be created. <br>This must be a String.</p>                             |
| `persistentObjectStruct` | <p>The properties of the persistent object you are creating.<br>This must be a Struct with all the properties in key-value form.</p> |

#### Returns

```
N/A
```

## Example Implementation

<pre><code><strong>var ball = {
</strong><strong>    type: "ball",
</strong><strong>    _x : 200,
</strong><strong>    _y : 200
</strong><strong>}
</strong><strong>CreatePersistentObject("public",ball)
</strong></code></pre>

This requests the server to create this object in the "public" room.

## How to know if the Object was made or not?

After a successful creation of object on your server, the callback function **callback\_CreatedPersistentObject()**  is called.&#x20;
