I have a script where it will teleport the player after 10 seconds randomly between two games, but the script will not teleport to a different game and in studio it tells me GameNotFound. Script:
local TeleportService = game:GetService("TeleportService") local gameID = 1537690962 local player = game.Players.LocalPlayer local gameId = 1537690962 wait(10) local random = math.random(2) -- Randomly chooses either 1 or 2 if random == 1 then TeleportService:Teleport(gameID, player) elseif random == 2 then TeleportService:Teleport(gameId, player) end
Make a list of Place IDs:
list = {"000000000", "000000000"} clickdetect = script.Parent -- I prefer to use ClickDetectors because they are easier to control than Touched events that require debounce techniques tpservice = game:GetService("TeleportService") function Teleport(player) for i = math.random(1, #list) do tpservice:Teleport(tonumber(list), player) wait(1) then break end end clickdetect.MouseClick:Connect(Teleport)
And PLEASE stop using local variables. You people clearly don't understand Lua 5.1.