createBird
Creates a managed bird element with its own renderer and flight control.
Syntax
bird|false createBird(float x, float y, float z [, table options])Arguments
xfloatWorld X.
yfloatWorld Y.
zfloatWorld Z.
optionstableoptionalOptional preset, speed, size, renderDistance, wingBeatTime, curvedFlight, shootable, movementEnabled, bodyColor, wingColor and velocity fields.
Table keys
presetstringoptional · default "normal"normal, water or desert. The presets differ visibly in size and flight cadence.
speedfloatoptionalInitial speed.
sizefloatoptionalSize multiplier.
renderDistancefloatoptionalDistance at which the bird fades out. It is not destroyed.
wingBeatTimefloatoptionalWing beat period. Must be greater than zero.
curvedFlightbooloptionalWhether the bird banks through curves instead of flying straight.
shootablebooloptionalWhether the bird takes part in gunshot hit testing.
movementEnabledbooloptionalWhether the bird flies. False freezes it while the rest of a flock keeps moving.
bodyColorcoloroptionalBody colour.
wingColorcoloroptionalWing colour.
velocitytableoptionalStarting velocity as {x, y, z}.
Returns
A bird element, or false when the position or options are rejected.
Ownership and lifecycle
A bird belongs to the client resource that created it and is removed when that resource stops. Birds fade near their render distance instead of being destroyed, and a dimension or interior mismatch hides them while keeping the element alive.
- preset accepts normal, water or desert, which differ visibly in size and flight cadence.
- Every option field is optional; omitted fields keep the preset default.
- Managed birds are not bound by GTA's six native ambient bird slots. The harness runs 128 at once.
- GTA's own ambient birds keep spawning and behaving independently.
OOP aliases
Bird.create(x, y, z, options)
Example
local bird = createBird(x, y, z, { preset = "desert", size = 1.5, shootable = true,})