CreateObject

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

Creates any GTASA world object at a specified location using x,y,z. The object rotation can also be set with the optional arguments rx, ry, rz.

Syntax

createObject ( id, x, y, z, [rx, ry, rz] )

Required Arguments

  • ID: A Whole integer specifying the GTASA object model ID
  • X: A Float value that specifies the X coordinate where the object is spawned at in the GTASA world
  • Y: A Float value that specifies the Y coordinate where the object is spawned at in the GTASA world
  • Z: A Float value that specifies the Z coordinate where the object is spawned at in the GTASA world

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • rx: A Float value that specifies the created objects X rotation
  • ry: A Float value that specifies the created objects Y rotation
  • rz: A Float value that specifies the created objects Z rotation

Example

Explain what the example does here

root = getRootElement ()
addEventHandler ( "onMapLoad", root, "onMapLoad" )
function onMapLoad ( name, root )
createObject ( 5540.6654, 1020.55122, 1240.545, 15, 10, 4.4, 6.2] )
end