Skip to main content

sm

The sm namespace contain all API features related to Scrap Mechanic.

Constants

Functions

exists

sm.exists( object )

Returns whether an object exists in the game.
This is useful for checking whether a reference to an object is valid.

Arguments:
  • object [ any ]: The object to check.
Returns:
  • [ bool ]: Whether the object exists or not.

isServerMode

sm.isServerMode( object )

Returns whether the script is currently running in server mode.
Otherwise, it is running in client mode. Server mode only occurs when sm.isHost is true.

Returns:
  • [ bool ]: Whether the script is running in server mode or not.