sm.portal

Associated object type: Portal

A portal moves objects inside a box to another box in another place.

Functions:

  • addWorldPortalHook
  • createPortal
  • destroy
  • popWorldPortalHook

  • sm.portal.addWorldPortalHook(world, name, portal)

    Server only

    Adds a hook that a new world can find to hook up the other side of a portal.

    Parameters:

    TypeNameDescription
    WorldworldThe target world.
    stringnameThe portal name.
    PortalportalThe portal.

    sm.portal.createPortal(dimensions)

    Server only

    Creates a new portal.

    Parameters:

    TypeNameDescription
    Vec3dimensionsThe dimensions of the portal box.

    Returns:

    TypeDescription
    PortalThe created portal.

    sm.portal.destroy(portal)

    Server only

    Destroys a portal.

    Parameters:

    TypeNameDescription
    PortalportalThe portal to be destroyed.

    sm.portal.popWorldPortalHook(name)

    Server only

    Finds and pops world hook for this world if present.

    Parameters:

    TypeNameDescription
    stringnameThe portal name.

    Returns:

    TypeDescription
    PortalThe portal. Nil if nothing was found.