Skip to main content

sm.tool

Associated object type: Tool

A tool is a scripted tool a player holds in their hand.
The tool object is focused on handling animations for first and third person view.

For more information about creating your own scripted tools, see ToolClass.

Constants

Functions

checkLiftCollision

sm.tool.checkLiftCollision( creation, position, rotation )

Used to check collisions between the lift and the world.

Arguments:
  • creation [ table ]: A table of all the bodies belonging to the creation placed on the lift.
  • position [ Vec3 ]: The lift position.
  • rotation [ int ]: The rotation of the creation on the lift.
Returns:
  • [ bool ]: Whether the lift collides with the world or not.
  • [ int ]: The lift level.

forceTool

sm.tool.forceTool( tool )
Client-Only

Force equip a tool for the local player.
Pass nil to unforce an already forced tool.

Arguments:

preloadRenderables

sm.tool.preloadRenderables( renderables )
Client-Only

Pre-loads renderable data to be used by the tool.
This eliminates excessive loading during run time.

Arguments:
  • renderables [ table ]: The table of renderable file paths.

uuidExists

sm.tool.uuidExists( uuid )

Returns whether the tool uuid exists.

Arguments:
Returns:
  • [ bool ]: Whether the uuid exists or not.