# setElementStreamable (Client)

> Chooses whether an element streams in and out with distance or always stays loaded.

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

## Syntax

```lua
bool setElementStreamable(element element, bool streamable)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `element` | `element` | The element. |
| `streamable` | `bool` | `true` to follow the distance (the default), `false` to always stay streamed in. |

## Returns

`true` if it changed, `false` if the element was already like that or is not a world element.

An element that does not follow the distance stays streamed in while it is in the focused dimension.

## Example

```lua
local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle then
    setElementStreamable(vehicle, false)
end
```

## See also

- [isElementStreamable (Client)](https://wiki.mymp.gg/en/isElementStreamable.md): Tells whether an element streams in and out with distance.
- [isElementStreamedIn (Client)](https://wiki.mymp.gg/en/isElementStreamedIn.md): Tells whether an element is loaded into this client's world.
