OPX//77
opx_infinityteleports

Client

Last updated on

The teleports contract on the client — the pad under the player, and using it.

local teleports = OPX.Api.Get('teleports')

From client code inside opx_infinity.

Nearest

The entrance the player is standing on.

teleports.Nearest()

Returns

  • Result — { key, leg, label, allowed }; error teleports.noSuchTeleport

Entrances

The last list the server sent.

teleports.Entrances()

Returns

  • Result — { entrances }, keyed key .. '\1' .. leg

Use

Same as pressing the key. "Ok" means sent; the result arrives on opx:on:teleports:decision.

teleports.Use(origin)

Parameters

  • origin?: string
    • The caller's name, reported back as source. Default 'key'.

Returns

  • { ok = true, key, leg, source }, or { ok = false, error } with a locale key: error.noPermission (input captured), teleports.busy (a progress bar is up), teleports.noSuchTeleport, teleports.inFlight, teleports.refused
Example
local sent = teleports.Use('mymodule')
if not sent.ok then print(sent.error) end

State

Counts and the current key label.

teleports.State()

Returns

  • Result — { entrances, markers, nearest, leg, allowed, shown, asking, key }

On this page