SetObjectModel

From Onset Developer Wiki
Revision as of 11:34, 27 September 2020 by 28days (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
SetObjectModel

Type: Function
Context: Server
Introduced: v1.1.0

Description

This function changes the model of the created object. This function calls OnObjectModelChange event on client side.

Syntax

SetObjectModel(objectid, modelid)


Parameters

  • objectid
    The object identifier.
  • modelid
    The model identifier for which object to spawn.

Return Value

  • Returns true on success.

Example

-- Spawn a weed object at 1000.0, 1000.0, 100.0
local object = CreateObject(64, 1000.0, 1000.0, 100.0)
-- Change the spawned weed object to a tree
SetObjectModel(object, 66)

See also