Scripting/Server/Functions/CreateObject
Creates a map object visible to everyone.
Syntax
CreateObject(model, x, y, z)CreateObject(model, pos [, angle])Arguments
- int model
- float x
- float y
- float z
- Vector pos
- float angle (optional)
Returns
Object or null.
Example
function onScriptLoad()
{
// a health-pickup model as a decoration, 2 m above the ground at the Portland docks
local obj = CreateObject( 1362, Vector( 1000.0, -870.0, 17.0 ) );
if ( obj ) obj.MoveTo( Vector( 1000.0, -870.0, 25.0 ), 2.0 );
}Related pages
- CreateVehicle
- CreatePickup
- CreateWeaponPickup
- CreateSphere
- CreateClientSphere
- CreateCheckpoint
- CreateClientCheckpoint
- FindCheckpoint
- GetCheckpointCount
- CreateBlip
- CreateClientBlip
- GangZoneCreate
Section: Creating world entities
Categories: Server functions | Creating world entities