getElementsByType
Client
Lists every element of a type below an element of the tree on this client.
Also exists on the server, with its own implementation: getElementsByType
table getElementsByType(string type [, element startAt = root, bool streamedIn = false])
Parameters
| Name | Type | Description |
|---|---|---|
| type | string | The type to look for, such as "vehicle" or a type from createElement. |
| startAt | element | The element the search goes down from.default root |
| streamedIn | bool | With true, leaves out the elements that are not loaded in this client's world.default false |
Returns
A table with the elements, empty if there are none.
Example
for _, ped in ipairs(getElementsByType("ped", root, true)) do
setElementCastShadow(ped, false)
end