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

How to make a auto game teleporter?

Asked by 5 years ago

Ok, so I am not a good scripter, am a terrible one who guesses infact..

here is the script:

local TeleportService = game:GetService("TeleportService") local gameID = 3869185466 -- put game id here

local function teleport()

wait(0.01) script.Parent.Value = 10 wait(1) script.Parent.Value = 9 wait(1) script.Parent.Value = 8 wait(1) script.Parent.Value = 7 wait(1) script.Parent.Value = 6 wait(1) script.Parent.Value = 5 wait(1) script.Parent.Value = 4 wait(1) script.Parent.Value = 3 wait(1) script.Parent.Value = 2 wait(1) script.Parent.Value = 1 wait(1) script.Parent.Value = 0 end teleport()

That is obviously not how you do it... can someone help me with this? After a certain amount of time for instance, 10 seconds they teleport to another game that you want, and the textlabel for that variable changes aswell like 10, 9, 8, ect.

0
N i c e ! greatneil80 2647 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Hi there! The ROBLOX Wiki is an extremely helpful tool in some cases, especially if you're unsure of what function to use, or what parameters are required for a specific function. In your case, you'd want to use TeleportService:Teleport(). This will allow you to teleport an individual player to a specified game.

Example:

game:GetService("TeleportService"):Teleport(920587237, game:GetService("Players")["TrueFalses"]) -- Teleports TrueFalses to game associated with the ID of 920587237.

Additionally, an easier way to do a countdown would be with a loop. Specifically, a for i loop. The script below will repeat 10 times, waiting 1 second after each time.

Example:

for i = 1,10 do -- For i loop. Repeats this 10 times.
    print(10 - i) -- Without this, it would count up instead of down.
    wait(1) -- Wait 1 second before going again.
end -- End the for i loop

Both of these put into your script would look something like this.

local gameID = 3869185466 -- put game id here

function Teleport()
    for i = 1,10 do -- For i loop. Repeats this 10 times.
        script.Parent.Value = 10 - i -- Without this, it would count up instead of down.
        wait(1) -- Wait 1 second before going again.
    end -- End the for i loop
    game:GetService("TeleportService"):Teleport(gameID, game:GetService("Players")["TrueFalses"]) -- Teleports TrueFalses to game associated with the ID specified in 'gameID'.
end

Teleport()
0
Hello! Thanks for answering. Two questions, where would this script be placed, and how do I make it so that instead of myself, local players will teleport in that certain time while the value counts from 10 to 0? Since in the scripts it says: game:GetService("Players")["TrueFalses"])<--- my name TrueFalses -15 — 5y
0
put it in a normal script. you're going to have to use remote events call the teleport function from a localscript. you must teleport on the server since roblox doesnt let you teleport from a local script. royaltoe 5144 — 5y
Ad

Answer this question