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.

Arguments:
Returns:
  • [ table ]: The table of characters and bodies in opening A.

getContentsB

portal:getContentsB()
Server-Only

Returns the contents of opening B.

Arguments:
Returns:
  • [ table ]: The table of characters and bodies in opening B.

getId

portal:getId()
Server-Only

Returns the portal's id.

Arguments:
Returns:
  • [ int ]: The portal's id.

getPositionA

portal:getPositionA()
Server-Only

Returns the position of portal opening A.

Arguments:
Returns:
  • [ Vec3 ]: The position of opening A.

getPositionB

portal:getPositionB()
Server-Only

Returns the position of portal opening B.

Arguments:
Returns:
  • [ Vec3 ]: The position of opening B.

getRotationA

portal:getRotationA()
Server-Only

Returns the rotation of portal opening A.

Arguments:
Returns:
  • [ Quat ]: The rotation of opening A.

getRotationB

portal:getRotationB()
Server-Only

Returns the rotation of portal opening B.

Arguments:
Returns:
  • [ Quat ]: The rotation of opening B.

getWorldA

portal:getWorldA()
Server-Only

Returns the world of portal opening A.

Arguments:
Returns:
  • [ World ]: The world of opening A.

getWorldB

portal:getWorldB()
Server-Only

Returns the world of portal opening B.

Arguments:
Returns:
  • [ World ]: The world of opening B.

hasOpeningA

portal:hasOpeningA()
Server-Only

Returns whether the portal has an opening A.

Arguments:
Returns:
  • [ bool ]: Whether the portal has an opening A or not.

hasOpeningB

portal:hasOpeningB()
Server-Only

Returns whether the portal has an opening B.

Arguments:
Returns:
  • [ bool ]: Whether the portal has an opening B or not.

setOpeningA

portal:setOpeningA( position, rotation )
Server-Only

Sets the portal's opening A.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
Returns:
  • [ bool ]: Whether the transfer was successful or not.

transferBToA

portal:transferBToA()
Server-Only

Transfers objects inside opening B to opening A.

Arguments:
Returns:
  • [ bool ]: Whether the transfer was successful or not.