#Need help with teleportation

1 messages · Page 1 of 1 (latest)

crystal raven
#

So i have to places in my roblox game and im trying to teleport from the place that handles gui loading and teleporation but teleporation isnt working it keeps giving me a error "check your internet connection" "the game server cannot be reached " and ive been stuck on this for days cant find the solution

daring horizon
crystal raven
#

here u go -- LobbyController (LocalScript under StarterGui → GameUI)
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local TeleportService= game:GetService("TeleportService")

local player = Players.LocalPlayer
local gui = player:WaitForChild("PlayerGui"):WaitForChild("GameUI")

-- UI refs
local loadingFrame = gui:WaitForChild("LoadingFrame")
local menuFrame = gui:WaitForChild("MenuFrame")
local singleBtn = menuFrame:WaitForChild("SingleplayerButton")
local multiBtn = menuFrame:WaitForChild("MultiplayerButton")

local progressBar = loadingFrame:WaitForChild("ProgressContainer")
:WaitForChild("ProgressBar")

-- Replace these with your actual Place IDs:
local SINGLEPLAYER_PLACE_ID = 91465655319725 -- gameplay place
local MULTIPLAYER_PLACE_ID = 137502878519027 -- future multiplayer lobby

-- 1) Simulate loading (5 seconds)
local function simulateLoading()
local totalTime = 5
local steps = 100
for i = 1, steps do
local pct = i/steps
progressBar.Size = UDim2.new(pct,0,1,0)
task.wait(totalTime/steps)
end
end

-- 2) Start
loadingFrame.Visible = true
menuFrame.Visible = false
task.spawn(function()
simulateLoading()
loadingFrame.Visible = false
menuFrame.Visible = true
end)

-- 3) Button handlers
singleBtn.MouseButton1Click:Connect(function()
singleBtn.Active = false
print("[LobbyController] Singleplayer clicked; teleporting to place "..SINGLEPLAYER_PLACE_ID)
TeleportService:Teleport(SINGLEPLAYER_PLACE_ID, player)
end)

multiBtn.MouseButton1Click:Connect(function()
multiBtn.Active = false
print("[LobbyController] Multiplayer clicked; teleporting to place "..MULTIPLAYER_PLACE_ID)
TeleportService:Teleport(MULTIPLAYER_PLACE_ID, player)
end)
"

crystal raven
#

yes i did because it wasnt working so i took chatgpts help

#

and its still not working

visual kraken
#

so what was the code you had before? (send it)

crystal raven
#

cant send it

#

too long

#

let me break it down

#

(this code doesnt manege the teleproation script this script is for the other place "local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local StarterPlayer= game:GetService("StarterPlayer")

local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local ui = playerGui:WaitForChild("GameUI")

local loading = ui:WaitForChild("LoadingFrame")
local menu = ui:WaitForChild("MenuFrame")
local playBtn = menu:WaitForChild("PlayButton")
local overlay = ui:WaitForChild("DangerOverlay")

local barContainer = loading:WaitForChild("ProgressContainer")
local bar = barContainer:WaitForChild("ProgressBar")

local cameraLocked = false

local function lockFirstPerson()
cameraLocked = true
player.CameraMode = Enum.CameraMode.LockFirstPerson
StarterPlayer.DevEnableMouseLock = true

modest briarBOT
#

studio** You are now Level 1! **studio

crystal raven
#

StarterPlayer.DevComputerCameraMaxZoomDistance = 0.5
StarterPlayer.DevComputerCameraMinZoomDistance = 0.5
end

RunService.RenderStepped:Connect(function()
if cameraLocked then
player.CameraMode = Enum.CameraMode.LockFirstPerson
end
end)

player.CharacterAdded:Connect(function()
if cameraLocked then
lockFirstPerson()
end
end)

local function showMenu()
loading.Visible = false
menu.Visible = true
playBtn.Active = true
end

if player:GetAttribute("HasLoadedOnce") then
loading.Visible = false
menu.Visible = false
lockFirstPerson()
else
player:SetAttribute("HasLoadedOnce", true)
loading.Visible = true
menu.Visible = false
overlay.BackgroundTransparency = 1
playBtn.Active = false

spawn(function()
    local total, steps = 10, 100
    for i = 1, steps do
        bar.Size = UDim2.new(i/steps, 0, 1, 0)
        task.wait(total/steps)
    end
    showMenu()
end)

end

playBtn.MouseButton1Click:Connect(function()
if not cameraLocked then
menu.Visible = false
lockFirstPerson()
end
end)

daring horizon
daring horizon
crystal raven
crystal raven
idle geode
#

Yo

#

What's poppin'?

#

Ah

#

Tping between places?

daring horizon
idle geode
#

Ain't that supposed to be the easiest thing

#

just shove in the id

#

what's the error?

crystal raven
#

ill send a video showcasing it

daring horizon
#

keep in mind he used chatgpt for the code

idle geode
#

ight

crystal raven
idle geode
#

bro wait

#

dont tell me ur testing teleportation in "Play F5" in studio

idle geode
#

alr then

#

where's the vid?

#

just gimme the game add

#

if it is published

#

which it ofc be

crystal raven
crystal raven
daring horizon