sm.portal
Associated object type: Portal
A portal moves objects inside a box to another box in another place.
Functions:
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:
Type | Name | Description |
---|---|---|
World | world | The target world. |
string | name | The portal name. |
Portal | portal | The portal. |
sm.portal.createPortal(dimensions)
Server only
Creates a new portal.
Parameters:
Type | Name | Description |
---|---|---|
Vec3 | dimensions | The dimensions of the portal box. |
Returns:
Type | Description |
---|---|
Portal | The created portal. |
sm.portal.destroy(portal)
Server only
Destroys a portal.
Parameters:
Type | Name | Description |
---|---|---|
Portal | portal | The portal to be destroyed. |
sm.portal.popWorldPortalHook(name)
Server only
Finds and pops world hook for this world if present.
Parameters:
Type | Name | Description |
---|---|---|
string | name | The portal name. |
Returns:
Type | Description |
---|---|
Portal | The portal. Nil if nothing was found. |