Scripting/Server/Functions/CreateObject

Creates a map object visible to everyone.

Syntax

CreateObject(model, x, y, z)
CreateObject(model, pos [, angle])

Arguments

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 );
}

Section: Creating world entities

Categories: Server functions | Creating world entities