Skip to content

REVO / API version 0.0.10

LocalObject

Created asynchronously when streamed in. Collections and lookups include only this resource’s objects.

new LocalObject(model, position, rotation, dynamic?): LocalObject

Parameter Type Description
model string | number -
position IVector3 -
rotation number | IVector3 | IQuaternion Heading or XYZ Euler angles in radians, or a non-zero quaternion (normalized on creation).
dynamic? boolean Whether the object uses dynamic physics. Defaults to true.

LocalObject

Object.constructor

Property Type Details
dimension number World ID, default 0. Writable on local objects created by this resource. The server controls other objects. globalDimension makes the object visible in every numbered world.

Overrides Object.dimension
dynamic
readonly
boolean Inherited from Object.dynamic
heading number Heading in radians.

Inherited from Object.heading
health number Inherited from Object.health
id
readonly
number Local ID, assigned independently on the client and server.

Inherited from Object.id
isLocallySimulated
readonly
boolean Simulation authority does not grant permission to change server-owned state.

Inherited from Object.isLocallySimulated
isNetworked
readonly
false Overrides Object.isNetworked
isStreamedIn
readonly
boolean Inherited from Object.isStreamedIn
maxHealth number Inherited from Object.maxHealth
netOwner
readonly
Player | null Inherited from Object.netOwner
networkId
readonly
null Server-assigned network ID, or null without replication. Separate from id.

Overrides Object.networkId
physicsAsleep
readonly
boolean Inherited from Object.physicsAsleep
ready
readonly
boolean The initial server state has been applied, or a client-only entity has streamed in.

Inherited from Object.ready
scriptID
readonly
number GTA handle, or 0 while not streamed in. Do not retain it across frames.

Inherited from Object.scriptID
streamDistance number | null Per-object distance in metres. null uses the streamer’s default.

Inherited from Object.streamDistance
streamingEnabled boolean Enables automatic streaming. Disabling it preserves the current streaming state. A dimension mismatch still suspends it until its dimension is visible again.

Inherited from Object.streamingEnabled
type
readonly
BaseType Inherited from Object.type
valid
readonly
boolean Inherited from Object.valid
all
static readonly
readonly LocalObject[] Overrides Object.all
count
static readonly
number Overrides Object.count
Accessor Type Details
angVelocity Read: Vector3
Write: IVector3
Angular velocity in radians per second.

Inherited from Object.angVelocity
modelHash Read: number
Write: string | number
Accepts a model name or nonzero hash of the same entity type. Returns the old hash until the new model is applied.

Overrides Object.modelHash
pos Read: Vector3
Write: IVector3
Inherited from Object.pos
quaternion Read: Quaternion
Write: IQuaternion
Inherited from Object.quaternion
rot Read: Vector3
Write: IVector3
Euler angles in radians, applied X, then Y, then Z.

Inherited from Object.rot
velocity Read: Vector3
Write: IVector3
Inherited from Object.velocity

activatePhysics(): void

void

Object.activatePhysics


destroy(): void

Deletes an entity created by this resource. Throws if the entity is networked, belongs to another resource, has been destroyed, or cannot be removed from GTA.

void

Object.destroy


getSyncedMeta<K>(key): ICustomBaseSyncedMeta[K] | undefined

Returns a copy. Client-only objects have no synced metadata.

Type Parameter
K extends never
Parameter Type
key K

ICustomBaseSyncedMeta[K] | undefined

Object.getSyncedMeta

getSyncedMeta<T>(key): T | undefined

Returns a copy. Client-only objects have no synced metadata.

Type Parameter Default type
T TransportValue
Parameter Type
key string

T | undefined

Object.getSyncedMeta


getSyncedMetaKeys(): string[]

string[]

Object.getSyncedMetaKeys


hasSyncedMeta(key): boolean

Parameter Type
key string

boolean

Object.hasSyncedMeta


setAppearance(alpha, textureVariation, lodDistance): void

Parameter Type Description
alpha number Integer in [0, 255].
textureVariation number Integer in [0, 255].
lodDistance number Integer in [-1, 65535]. -1 restores the model default.

void

Object.setAppearance


static getById(id): LocalObject | null

Parameter Type
id number

LocalObject | null

Object.getById


static getByNetworkId(networkId): null

Parameter Type
networkId number

null

Object.getByNetworkId


static getByScriptId(scriptID): LocalObject | null

Parameter Type
scriptID number

LocalObject | null

Object.getByScriptId

Moving entities and attaching props