local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")
local button = script.Parent
local gameID = 189707
button.MouseButton1Click:Connect(function(click)
local player = Players:GetPlayerFromCharacter(click.Parent)
if player then
TeleportService:Teleport(gameID, player)
end
end)
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local TeleportService = game:GetService("TeleportService")
local button = script.Parent
local gameID = 189707
button.MouseButton1Click:Connect(function()
TeleportService:Teleport(gameID, player)
end)
‘Teleporting’ in Roblox, describes the transportation of Players between different places and servers. TeleportService provides a range of functions allowing single or groups of users to be teleported. As Roblox games can contain multiple places, you can use the TeleportService to teleport players between different levels.