#Need help with teleportation
1 messages · Page 1 of 1 (latest)
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)
"
did you use ai for this
yes i did because it wasnt working so i took chatgpts help
and its still not working
so what was the code you had before? (send it)
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
** You are now Level 1! **
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)
i love how u’re able to detect it right away
are you trying to teleport to a place that u dont own?
bro they are instructions in the script ofc someone will be able to detect it
no its mine
ye
ill send a video showcasing it
keep in mind he used chatgpt for the code
ight
for the first one that is
no no
alr then
where's the vid?
just gimme the game add
if it is published
which it ofc be
alr
make it mp4 bro