Scripting/Server/Classes/Object
| Property | Type | Access | Description |
|---|---|---|---|
ID | integer | r | |
Model | integer | r | Model id. |
Pos | Vector | rw | Position. |
Angle / Rotation | Vector | rw | Euler rotation. Assigning a plain number to Angle sets just the Z rotation. |
Scale | Vector | rw | v0.3+: visual scale on every client (default 1,1,1). The collision keeps the original size. |
IsDoor / Door | bool | rw | v0.5-rc3+: true = a swing door. The object stays where it is; when a player or ped walks into it, every client swings it open around the model ORIGIN (build the model with the origin on the hinge) away from the one who pushes it, so it opens whichever side he comes from, and it falls back shut by itself. The swing is simulated on every client, nothing is sent while it moves. The leaf is taken from the collision box of the model (its longer axis). Default false. |
IsDynamic / Dynamic | bool | rw | v0.3.1-r3+: false (default) = the object is map geometry: players and vehicles cast shadows on it, a molotov burns on top of it, the game finds the ground on it. true = a prop (bin, crate, lamp post). Set it to true for objects that should behave like ordinary game objects. (alias Dynamic) |
AttachCollision / KeepCollision | bool | rw | v0.3.1-r5+: false (default) = an attached object (AttachTo) has no collision. true = it keeps its collision while attached, so players and cars can stand on it or bump into it; it never collides with the thing it is attached to. (alias KeepCollision) |
Colour / Color / Tint | Colour|null | rw | The colour the object's materials are drawn with, for models whose materials have no texture (San Andreas car parts take the colour of the car). Assign a Colour or 0xRRGGBB; null, false or -1 gives the model its own look back. Reading returns a Colour, or null when no tint is set. |
IsAttached / Attached | bool | r | true while the object is glued to something (after AttachTo, AttachToBone or an attachment saved by the object editor). |
AttachOffset | Vector | r | Where the object is glued, in the parent's frame (for a bone: the bone frame) - the same values AttachToBone takes. |
AttachRotation | Vector | r | The rotation relative to the parent, in the same frame as AttachOffset. |
AttachBone | integer | r | The bone id the object was attached to with AttachToBone. |
VirtualWorld | integer | rw |
Methods and functions
- object.Remove – Deletes the object.
- object.MoveTo – Slides the object to a position.
- object.RotateTo – Rotates the object to the given euler angles.
Categories: Server classes