Skip to main content

Portal

Associated namespace: sm.portal

A userdata object representing a portal in the game.

Values:

  • id [ int ]

    • Get: (Server-Only) The portal's id.

Operations:

OperationDescription
Portal == PortalChecks if two instances of Portal refer to the same Portal.

functions

getContentsA

portal:getContentsA()

Server-Only

Returns the contents of opening A.

Parameters:

Returns:

  • (table): The table of characters and bodies in opening A.

getContentsB

portal:getContentsB()

Server-Only

Returns the contents of opening B.

Parameters:

Returns:

  • (table): The table of characters and bodies in opening B.

getId

portal:getId()

Server-Only

Returns the portal's id.

Parameters:

Returns:

  • (int): The portal's id.

getPositionA

portal:getPositionA()

Server-Only

Returns the position of portal opening A.

Parameters:

Returns:

  • (Vec3): The position of opening A.

getPositionB

portal:getPositionB()

Server-Only

Returns the position of portal opening B.

Parameters:

Returns:

  • (Vec3): The position of opening B.

getRotationA

portal:getRotationA()

Server-Only

Returns the rotation of portal opening A.

Parameters:

Returns:

  • (Quat): The rotation of opening A.

getRotationB

portal:getRotationB()

Server-Only

Returns the rotation of portal opening B.

Parameters:

Returns:

  • (Quat): The rotation of opening B.

getWorldA

portal:getWorldA()

Server-Only

Returns the world of portal opening A.

Parameters:

Returns:

  • (World): The world of opening A.

getWorldB

portal:getWorldB()

Server-Only

Returns the world of portal opening B.

Parameters:

Returns:

  • (World): The world of opening B.

hasOpeningA

portal:hasOpeningA()

Server-Only

Returns whether the portal has an opening A.

Parameters:

Returns:

  • (boolean): Whether the portal has an opening A or not.

hasOpeningB

portal:hasOpeningB()

Server-Only

Returns whether the portal has an opening B.

Parameters:

Returns:

  • (boolean): Whether the portal has an opening B or not.

setOpeningA

portal:setOpeningA( position, rotation )

Server-Only

Sets the portal's opening A.

Parameters:

  • portal (Portal): The portal.
  • position (Vec3): The opening position.
  • rotation (Quat): The the opening rotation.

setOpeningB

portal:setOpeningB( position, rotation )

Server-Only

Sets the portal's opening B.

Parameters:

  • portal (Portal): The portal.
  • position (Vec3): The opening position.
  • rotation (Quat): The the opening rotation.

transferAToB

portal:transferAToB()

Server-Only

Transfers objects inside opening A to opening B.

Parameters:

Returns:

  • (boolean): Whether the transfer was successful or not.

transferBToA

portal:transferBToA()

Server-Only

Transfers objects inside opening B to opening A.

Parameters:

Returns:

  • (boolean): Whether the transfer was successful or not.