Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My teleport script isn't working?

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

2 comments

0

I think the script crash ;-;. You didn't even put a cooldown

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

1 answer

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


3 comments

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

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

0

I put a wait(1) and it still doesn't tp

This discussion is preserved as it was. New answers, comments, and votes are closed.