# onClientElementStreamOut (Client)

> Fired when an element streams out on this client and leaves the game world. The element still exists.

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

## Syntax

```lua
addEventHandler("onClientElementStreamOut", root, function() ... end)
```

## Source

The player, ped, vehicle, object or sound that streamed out.

### Streaming rules

- **World elements (`player`, `ped`, `vehicle`, `object`):** stream in within `250` m of the camera's focus and stream out past `300` m, only in the focused dimension. An element with `setElementStreamable(element, false)` always stays streamed in.
- **Frame budget:** at most `6` elements stream in and `6` stream out per frame.
- **Sounds (`sound`):** stream in when the listener is within `20` m of the sound's maximum distance and stream out past `40` m or outside the focused dimension.

## Example

```lua
local nearby = {}

addEventHandler("onClientElementStreamIn", root, function()
    nearby[source] = true
end)

addEventHandler("onClientElementStreamOut", root, function()
    nearby[source] = nil
end)
```

## See also

- [onClientElementStreamIn (Client)](https://wiki.mymp.gg/en/onClientElementStreamIn.md): Fired when an element streams in on this client and comes into the game world.
- [isElementStreamedIn (Client)](https://wiki.mymp.gg/en/isElementStreamedIn.md): Tells whether an element is loaded into this client's world.
- [setElementStreamable (Client)](https://wiki.mymp.gg/en/setElementStreamable.md): Chooses whether an element streams in and out with distance or always stays loaded.
