> 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/editpersistentobject-persistentobjectid-new_persistentobjectstruct.md).

# EditPersistentObject(persistentObjectId ,  new\_persistentObjectStruct)

## Description

This function edits a persistent object after you provide its ID.

#### Syntax

```
EditPersistentObject(persistentObjectId ,  new_persistentObjectStruct)
```

| Argument                      | Description                                                                                                                      |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `persistentObjectId`          | <p>The ID of the persistent object. (this is RNet's Per. Obj. ID, not GM instance or GM object ID)<br>This must be a Number.</p> |
| new\_`persistentObjectStruct` | <p>The edited properties of the persistent object.<br>This must be a Struct with all the properties in key-value form.</p>       |

#### Returns

```
N/A
```

## Example Implementation

<pre><code><strong>//Get the ball first (assuming you dont know its POid)
</strong><strong>var ballPOid = -1;
</strong><strong>with(oPersistentObject){
</strong><strong>    if(persistentObjectProperties.type == "ball"){
</strong><strong>        ballPOid = persistentObjectId
</strong><strong>    }
</strong><strong>}
</strong><strong>var ball_updated = {
</strong><strong>    type: "ball",
</strong><strong>    _x : 400,
</strong><strong>    _y : 400
</strong><strong>}
</strong><strong>EditPersistentObject(ballPOid,ball_updated)
</strong></code></pre>

This requests the server to edit the ball's properties, and is likewise updated on everyone else's screen.
