We use cookies on this site to enhance your user experience

Teleporting from the server

Teleporting from the server

Sep 11 2018, 3:08 AM PST

This snippet demonstrates how TeleportService can be used to teleport a Player from the server.

local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")

local placeId = 0 -- replace here
local userId = 1 -- replace with player's userId

-- find the player
local player = Players:GetPlayerByUserId(userId)

-- teleport the player
TeleportService:Teleport(placeId, player)