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

GameNotFound when trying to teleport?

Asked by 6 years ago
Edited 6 years ago

I have a script that randomly chooses to teleport the player between 2 different games but when it chooses a game it tells me GameNotFound even though I have copied the Id of the 2 games multiple times and made sure they were public multiple times, the error will continue to pop up (doesn't work in game either). Script:

local TeleportService = game:GetService("TeleportService")
local gameID = 1766746368
local player = game.Players.LocalPlayer
local gameId = 1766751281

wait(math.random(10, 20))

local random = math.random(2)

if random == 1 then
    TeleportService:Teleport(gameID, player)
elseif random == 2 then
    TeleportService:Teleport(gameId, player)
end
0
post your game links awesomeipod 607 — 6y

1 answer

Log in to vote
0
Answered by
cabbler 1942 Moderation Voter
6 years ago

TeleportService doesn't work in studio. It will work ingame.

0
doesn't work in game lolkid007 43 — 6y
0
nope I tested it. works. cabbler 1942 — 6y
0
not for me lolkid007 43 — 6y
Ad

Answer this question