Portal

Associated namespace: sm.portal

A userdata object representing an portal in the game.

Values:

Functions:

Operations:

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

id integer

Get:

Server only

Returns the id of a portal.


getContentsA(portal)

Server only

Gets the contents of opening A

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
tableA table of contents of type Character and Body.

getContentsB(portal)

Server only

Gets the contents of opening B

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
tableA table of contents of type Character and Body.

getId(portal)

Server only

Returns the id of a portal.

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
integerThe portal's id.

getPositionA(portal)

Server only

Returns the position of portal opening A.

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
Vec3The portal opening A position.

getPositionB(portal)

Server only

Returns the position of portal opening B.

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
Vec3The portal opening B position.

getRotationA(portal)

Server only

Returns the rotation of portal opening A.

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
QuatThe portal opening A rotation.

getRotationB(portal)

Server only

Returns the rotation of portal opening B.

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
QuatThe portal opening B rotation.

getWorldA(portal)

Server only

Returns the world of a portal opening A.

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
WorldThe portal opening A world.

getWorldB(portal)

Server only

Returns the world of a portal opening B.

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
WorldThe portal opening B world.

hasOpeningA(portal)

Server only

Checks if the portal has opening A.

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
booleanTrue if opening A exists, false if not.

hasOpeningB(portal)

Server only

Checks if the portal has opening B.

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
booleanTrue if opening B exists, false if not.

setOpeningA(portal, position, rotation)

Server only

Sets the position of portal opening A.

The world will be the same as the object that calls this function.

Parameters:

TypeNameDescription
PortalportalThe portal.
Vec3positionThe portal opening A position.
QuatrotationThe portal opening A rotation.

setOpeningB(portal, position, rotation)

Server only

Sets the position B of portal opening B.

The world will be the same as the object that calls this function.

Parameters:

TypeNameDescription
PortalportalThe portal.
Vec3positionThe portal opening B position.
QuatrotationThe portal opening B rotation.

transferAToB(portal)

Server only

Transfers objects inside A opening to B opening

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
booleanTrue if successful, false on failure.

transferBToA(portal)

Server only

Transfers objects inside B opening to A opening

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
booleantrue if successful, false on failure.