createObject

From GTA Connected
Jump to: navigation, search

Function Server and Client All Games Online and Offline

Server 1.0.0, Client 1.0.0

Server:
Object createObject(int model, Vec3 pos)
Client:

Description

The createObject function is used to create a visual object for the local client.

Parameters

Type Name Presence Default Value Description
int model required n/a The model ID for the object.
Vec3 pos required n/a The 3D position for the object. Server only.

Returns

Success Returns

Type Description
Object An object representing the visual game object that was created.

Failure Returns

Type Value
null n/a

Notes

  • createObject doesn't function properly on the client.

Examples

Example 1 - Lua:

object = createObject(1335, Vec3(1062.316, -662.653, 14.652))
if object ~= nil then
    object.heading = 1.5922862291336
end

Compatibility

  • This function was previously named game.createObject in version 1.0.71.

Related

Server Related

createObject

object.children
object.dimension
object.getData
object.getRotation
object.heading
object.id
object.interior
object.isType
object.matrix
object.modelIndex
object.name
object.onAllDimensions
object.parent
object.position
object.removeAllData
object.removeData
object.resource
object.setData
object.setRotation
object.setSyncer
object.syncer
object.type


Client Related

createObject
getObjects
gta.removeWorldObject

object.alpha
object.boundingCentre
object.boundingMax
object.boundingMin
object.boundingRadius
object.centerOfMass
object.children
object.collisionPower
object.collisionsEnabled
object.dimension
object.distanceFromCentreOfMassToBaseOfModel
object.getData
object.getRotation
object.heading
object.id
object.interior
object.isLocal
object.isOnScreen
object.isSyncer
object.isType
object.markAsNoLongerNeeded
object.mass
object.matrix
object.modelIndex
object.name
object.parent
object.position
object.removeAllData
object.removeData
object.setData
object.setProofs
object.setRotation
object.status
object.syncer
object.turnVelocity
object.type
object.velocity