Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do i make a game teleporter?

Asked by 5 years ago

im trying to make a teleporter from game to game, but all im getting is worthless stuff from 2017, can someone help me?

3 answers

Log in to vote
0
Answered by 5 years ago

Here's an example I made, when a player touches the part (function onTouched) then it teleports the player to another game, to teleport the player to that game you need to tell the script the gameID because that's the way it find game you don't just type their names, every game's ID is in the URL of it, so here buddy take this example script but change the ID to your ID and if you want the change the function for example if you want it to work when you press a GUI button just change the function from onTouched to onClick with a script in the GUI button, hope it helps.

local TeleportService = game:GetService("TeleportService")
local gameID = 1539354816

function onTouched(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        TeleportService:Teleport(gameID, player)
    end
end

script.Parent.Touched:connect(onTouched)
0
ok, but how do i set it to the closest player? element0310 0 — 5y
0
what im trying to do is build a lobby that sends you to the tycoon you choose, but i want a separate game for each set of tycoons, just to keep the lag down as there will be 8 people allowed on a server element0310 0 — 5y
Ad
Log in to vote
0
Answered by
metryy 306 Moderation Voter
5 years ago
Edited 5 years ago

You can use the Teleport method of TeleportService to teleport a player to a different place. It takes 4 arguments: the place id (int64), the player (instance), teleport data (any type), and a custom loading screen (instance).

Wiki: https://developer.roblox.com/en-us/api-reference/function/TeleportService/Teleport

Example:

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

local placeId = 1234

Players.PlayerAdded:Player(Connect(function(player)
    TeleportService:Teleport(player, placeId)
end)
Log in to vote
0
Answered by 5 years ago

what im trying to do is build a lobby that sends you to the tycoon you choose, but i want a separate game for each set of tycoons, just to keep the lag down as there will be 8 people allowed on a server so i need a teleporter that allows people people to touch it, and send the person why touched it to the tycoon

0
Dude the script I sent you sends the guy that touched that part to the game chacha489 16 — 5y

Answer this question