# onElementInteriorChange (Server)

> Fired after an element moves to another interior. It does not fire when the interior stays the same.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Event
- **Side**: Server
- **Category**: Elements
- **URL**: https://wiki.mymp.gg/en/onElementInteriorChange

## Syntax

```lua
addEventHandler("onElementInteriorChange", root, function(int oldInterior, int newInterior) ... end)
```

## Handler parameters

| Name | Type | Description |
| --- | --- | --- |
| `oldInterior` | `int` | The previous interior. |
| `newInterior` | `int` | The new interior. |

## Source

The element (player, ped, vehicle, object or sound) that changed interior.

## Example

```lua
addEventHandler("onElementInteriorChange", root, function(oldInterior, newInterior)
    if getElementType(source) == "player" and newInterior ~= 0 then
        setElementDimension(source, 0)
    end
end)
```

## See also

- [setElementInterior (Shared)](https://wiki.mymp.gg/en/setElementInterior.md): Changes an element's interior.
- [getElementInterior (Shared)](https://wiki.mymp.gg/en/getElementInterior.md): Reads the interior an element is in. Interior 0 is the outside world.
- [onClientElementInteriorChange (Client)](https://wiki.mymp.gg/en/onClientElementInteriorChange.md): Fired after an element moves to another interior. It does not fire when the interior stays the same.
