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

My teleport script isn't working?

Asked by 2 years ago
Edited 2 years ago

I have this server script in ServerScriptService and I tried in regular Roblox but it doesn't send me anywhere when I run the game but it prints "Running" once

while true do
    print("Running")

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

    local code = TS:ReserveServer(8357468682)
    local players = Players:GetPlayers()
    TS:TeleportToPrivateServer(8357468682,code,players) 
end
0
I think the script crash ;-;. You didn't even put a cooldown AProgrammR 398 — 2y
0
Just like what @AProgrammR said, it is possible that you just crashed the script by doing while true do, meaning an infinite loop; therefore throwing an error because of exhaustion. Try putting a delay/cooldown NotThatFamouss 605 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

The script most likely broke. Roblox studio crashes when you dont put a wait() in a while true do.~~~~~~~~~~~~~~~~~

while true do
    print("Running")
 wait()
    local TS = game:GetService("TeleportService")
    local Players = game:GetService("Players")
    local code = TS:ReserveServer(8357468682)
    local players = Players:GetPlayers()
    TS:TeleportToPrivateServer(8357468682,code,players)
end

~~~~~~~~~~~~~~~~~

0
It still doesn't work, is there anything wrong with my script? It's supposed to teleport the player to a reserved server of a sub game User#39520 0 — 2y
0
It still doesn't work, is there anything wrong with my script? It's supposed to teleport the player to a reserved server of a sub game User#39520 0 — 2y
0
I put a wait(1) and it still doesn't tp User#39520 0 — 2y
Ad

Answer this question