Skip to main content

Teleport

This is a MapLib Feature. It can be accessed by MapLib:GetFeature("Teleport").

Functions

Teleport

This item only works when running on the client. Client
since 0.11
</>
Teleport:Teleport(
player{Player?} | Player,
endingPositionCFrame | Vector3,
faceFrontboolean
) → ()

This function can be used to teleport players.

Example:

--Teleports all players ingame to map.Destination and makes the camera face the front.
local PlayersFeature = MapLib:GetFeature("Players")
local TeleportFeature = MapLib:GetFeature("Teleport")

for _, player in pairs(PlayersFeature:GetPlayers()) do
	TeleportFeature:Teleport(player, map.Destination.Position, true)
end
Show raw api
{
    "functions": [
        {
            "name": "Teleport",
            "desc": "This function can be used to teleport players.\n\n**Example:**\n```lua\n--Teleports all players ingame to map.Destination and makes the camera face the front.\nlocal PlayersFeature = MapLib:GetFeature(\"Players\")\nlocal TeleportFeature = MapLib:GetFeature(\"Teleport\")\n\nfor _, player in pairs(PlayersFeature:GetPlayers()) do\n\tTeleportFeature:Teleport(player, map.Destination.Position, true)\nend\n```",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "{ Player? } | Player"
                },
                {
                    "name": "endingPosition",
                    "desc": "",
                    "lua_type": "CFrame | Vector3"
                },
                {
                    "name": "faceFront",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "method",
            "realm": [
                "Client"
            ],
            "since": "0.11",
            "source": {
                "line": 39,
                "path": "src/Features/Teleport.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Teleport",
    "desc": "This is a MapLib Feature. It can be accessed by `MapLib:GetFeature(\"Teleport\")`.",
    "source": {
        "line": 17,
        "path": "src/Features/Teleport.lua"
    }
}