sm.portal
Associated object type: Portal
A Portal is a box-shaped trigger that can be used to teleport its contents to another location.
warning
This feature is very sensitive to "wrong" use and requires careful scripting to avoid triggering race conditions, bugs or game crashes.
Functions
addWorldPortalHook
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:
createPortal
local portal = sm.portal.createPortal(size)
Server-Only
Creates a new portal.
Parameters:
size(Vec3): The size.
Returns:
- (Portal): The created portal.
destroy
sm.portal.destroy(portal)
Server-Only
Destroys a portal.
Parameters:
portal(Portal): The portal.
popWorldPortalHook
local portal = sm.portal.popWorldPortalHook(name)
Server-Only
Finds and pops a portal hook for this world if present.
Parameters:
name(string): The portal name.
Returns:
- (Portal): The portal. Nil if nothing was found.