onClientElementStreamOut
ClientEvent
Fired when an element streams out on this client and leaves the game world. The element still exists.
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 within250m of the camera's focus and stream out past300m, only in the focused dimension. An element withsetElementStreamable(element, false)always stays streamed in. - Frame budget: at most
6elements stream in and6stream out per frame. - Sounds (
sound): stream in when the listener is within20m of the sound's maximum distance and stream out past40m or outside the focused dimension.
Example
local nearby = {}
addEventHandler("onClientElementStreamIn", root, function()
nearby[source] = true
end)
addEventHandler("onClientElementStreamOut", root, function()
nearby[source] = nil
end)