Skip to main content

sm.scriptableObject

Associated object type: ScriptableObject

A ScriptableObject is a virtual object which has no visual appearance and does not interact with physics.
It exists purely to execute a Lua script in the background, which will be synchronized to clients similar to other game objects.

Functions

createScriptableObject

local sob = sm.scriptableObject.createScriptableObject(uuid, params, world)

Server-Only

Creates a new ScriptableObject.

note

If no world is given, the object's script class cannot use world-dependent APIs such as sm.physics.

Parameters:

  • uuid (Uuid): The object's UUID.
  • params (any): Extra data. Available as self.params in the object's script. Optional.
  • world (World, optional): The world which the object belongs to, for world dependent API calls. Defaults to sm.world.ids.noWorld.

Returns: