Perfect! You want that classic story game lobby experience. Here's the complete setup:
────────────────────────────────────────────
LOBBY SETUP WITH GUI & FORCE ZONE
────────────────────────────────────────────
STEP 1: Build the Physical Setup
- Create a Part called "TeleportPad" in Workspace
- Create an invisible Part called "ForceZone" that's bigger than the pad (this traps players)
- Create a Part called "GUIAnchor" above the pad (where the GUI will float)
STEP 2: Create the GUI
- In StarterGui, create a ScreenGui called "LobbyGui"
- Inside that, create a BillboardGui called "TeleportDisplay"
- Set the BillboardGui's Adornee to the GUIAnchor part
- Inside BillboardGui, add:
- Frame (main background)
- TextLabel called "Title" (says "DELIVERY MISSION")
- TextLabel called "PlayerCount" (shows "2/4 Players")
- TextLabel called "Status" (shows countdown or "Teleporting...")
- TextButton called "LeaveButton" (says "LEAVE")
STEP 3: The Complete Script System
Put this ServerScript in ServerScriptService called "LobbyManager":
-- LobbyManager (ServerScript)
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DELIVERY_PLACE_ID = 12345678 -- 🔁 Replace with your delivery place ID
local MIN_PLAYERS = 2
local MAX_PLAYERS = 4
local COUNTDOWN_TIME = 10
-- Physical parts
local teleportPad = workspace:WaitForChild("TeleportPad")
local forceZone = workspace:WaitForChild("ForceZone")
local guiAnchor = workspace:WaitForChild("GUIAnchor")
-- Create RemoteEvents for GUI communication
local updateGUI = Instance.new("RemoteEvent")
updateGUI.Name = "UpdateLobbyGUI"
updateGUI.Parent = ReplicatedStorage
local leaveQueue = Instance.new("RemoteEvent")
leaveQueue.Name = "LeaveQueue"
leaveQueue.Parent = ReplicatedStorage
-- Queue management
local playersInQueue = {}
local isCountingDown = false
local countdownCoroutine = nil
-- Utility functions
local function isPlayerInQueue(player)
for _, p in ipairs(playersInQueue) do
if p == player then return true end
end
return false
end
local function removeFromQueue(player)
for i, p in ipairs(playersInQueue) do
if p == player then
table.remove(playersInQueue, i)
break
end
end
updateAllGUIs()
end
local function addToQueue(player)
if #playersInQueue >= MAX_PLAYERS then return false end
if isPlayerInQueue(player) then return false end
table.insert(playersInQueue, player)
-- Teleport player to the pad center and lock them
if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
player.Character.HumanoidRootPart.CFrame = teleportPad.CFrame + Vector3.new(0, 5, 0)
player.Character.HumanoidRootPart.Anchored = true
end
updateAllGUIs()
-- Start countdown if we have enough players
if #playersInQueue >= MIN_PLAYERS and not isCountingDown then
startCountdown()
end
return true
end
local function updateAllGUIs()
local playerCount = #playersInQueue .. "/" .. MAX_PLAYERS .. " Players"
local status = "Waiting for players..."
if #playersInQueue >= MIN_PLAYERS and not isCountingDown then
status = "Ready to start!"
end
updateGUI:FireAllClients(playerCount, status, playersInQueue)
end
local function startCountdown()
if isCountingDown then return end
isCountingDown = true
countdownCoroutine = coroutine.create(function()
for i = COUNTDOWN_TIME, 1, -1 do
if #playersInQueue < MIN_PLAYERS then
isCountingDown = false
updateAllGUIs()
return
end
local status = "Starting in " .. i .. "..."
updateGUI:FireAllClients(#playersInQueue .. "/" .. MAX_PLAYERS .. " Players", status, playersInQueue)
wait(1)
end
-- Teleport time!
if #playersInQueue >= MIN_PLAYERS then
updateGUI:FireAllClients(#playersInQueue .. "/" .. MAX_PLAYERS .. " Players", "TELEPORTING...", playersInQueue)
local options = Instance.new("TeleportOptions")
options.ShouldReserveServer = true
local playersToTeleport = {unpack(playersInQueue)}
local success, err = pcall(function()
TeleportService:TeleportPartyAsync(DELIVERY_PLACE_ID, playersToTeleport, options)
end)
if not success then
warn("Teleport failed: " .. err)
updateGUI:FireAllClients(#playersInQueue .. "/" .. MAX_PLAYERS .. " Players", "Teleport failed! Try again.", playersInQueue)
end
end
-- Reset
for _, player in ipairs(playersInQueue) do
if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
player.Character.HumanoidRootPart.Anchored = false
end
end
playersInQueue = {}
isCountingDown = false
updateAllGUIs()
end)
coroutine.resume(countdownCoroutine)
end
-- Force zone detection (traps players)
forceZone.Touched:Connect(function(hit)
local character = hit.Parent
local player = Players:GetPlayerFromCharacter(character)
if player and character:FindFirstChild("Humanoid") then
addToQueue(player)
end
end)
-- Handle leave requests
leaveQueue.OnServerEvent:Connect(function(player)
if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
player.Character.HumanoidRootPart.Anchored = false
-- Teleport them away from the pad
player.Character.HumanoidRootPart.CFrame = teleportPad.CFrame + Vector3.new(0, 5, 20)
end
removeFromQueue(player)
-- Stop countdown if not enough players
if #playersInQueue < MIN_PLAYERS and isCountingDown then
isCountingDown = false
if countdownCoroutine then
coroutine.close(countdownCoroutine)
end
updateAllGUIs()
end
end)
-- Clean up when players leave
Players.PlayerRemoving:Connect(function(player)
removeFromQueue(player)
if #playersInQueue < MIN_PLAYERS and isCountingDown then
isCountingDown = false
if countdownCoroutine then
coroutine.close(countdownCoroutine)
end
updateAllGUIs()
end
end)
-- Initialize
updateAllGUIs()
STEP 4: Client-Side GUI Handler
Put this LocalScript in StarterPlayerScripts called "LobbyGUIHandler":
-- LobbyGUIHandler (LocalScript)
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
-- Wait for RemoteEvents
local updateGUI = ReplicatedStorage:WaitForChild("UpdateLobbyGUI")
local leaveQueue = ReplicatedStorage:WaitForChild("LeaveQueue")
-- Wait for GUI elements
local lobbyGui = playerGui:WaitForChild("LobbyGui")
local teleportDisplay = lobbyGui:WaitForChild("TeleportDisplay")
local frame = teleportDisplay:WaitForChild("Frame")
local title = frame:WaitForChild("Title")
local playerCount = frame:WaitForChild("PlayerCount")
local status = frame:WaitForChild("Status")
local leaveButton = frame:WaitForChild("LeaveButton")
-- Set up the GUI anchor
local guiAnchor = workspace:WaitForChild("GUIAnchor")
teleportDisplay.Adornee = guiAnchor
-- Style the GUI (optional - customize as you like!)
frame.Size = UDim2.new(0, 300, 0, 150)
frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
frame.BorderSizePixel = 2
frame.BorderColor3 = Color3.fromRGB(255, 255, 255)
title.Size = UDim2.new(1, 0, 0.3, 0)
title.BackgroundTransparency = 1
title.Text = "🚚 DELIVERY MISSION"
title.TextColor3 = Color3.fromRGB(255, 255, 255)
title.TextScaled = true
title.Font = Enum.Font.GothamBold
playerCount.Size = UDim2.new(1, 0, 0.25, 0)
playerCount.Position = UDim2.new(0, 0, 0.3, 0)
playerCount.BackgroundTransparency = 1
playerCount.TextColor3 = Color3.fromRGB(200, 200, 200)
playerCount.TextScaled = true
status.Size = UDim2.new(1, 0, 0.25, 0)
status.Position = UDim2.new(0, 0, 0.55, 0)
status.BackgroundTransparency = 1
status.TextColor3 = Color3.fromRGB(255, 255, 100)
status.TextScaled = true
leaveButton.Size = UDim2.new(0.8, 0, 0.2, 0)
leaveButton.Position = UDim2.new(0.1, 0, 0.8, 0)
leaveButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
leaveButton.Text = "LEAVE QUEUE"
leaveButton.TextColor3 = Color3.fromRGB(255, 255, 255)
leaveButton.TextScaled = true
-- Handle GUI updates from server
updateGUI.OnClientEvent:Connect(function(playerCountText, statusText, queuedPlayers)
playerCount.Text = playerCountText
status.Text = statusText
-- Show/hide leave button based on if this player is in queue
local isInQueue = false
for _, p in ipairs(queuedPlayers) do
if p == player then
isInQueue = true
break
end
end
leaveButton.Visible = isInQueue
end)
-- Handle leave button click
leaveButton.MouseButton1Click:Connect(function()
leaveQueue:FireServer()
end)
────────────────────────────────────────────
WHAT THIS DOES:
────────────────────────────────────────────
✅ GUI floating above the teleport pad showing mission info
✅ Force zone - step near the pad and you're locked in place
✅ Player counter updates in real-time (2/4 Players)
✅ Countdown timer (Starting in 10... 9... 8...)
✅ "TELEPORTING..." text when countdown hits 0
✅ Leave button appears only when you're in the queue
✅ Can't walk out - you're anchored until you leave or teleport
Just replace the DELIVERY_PLACE_ID with your actual delivery place ID, build the parts (TeleportPad, ForceZone, GUIAnchor), create the GUI structure in StarterGui, and you're golden!
The experience will feel exactly like those popular story games. Want me to help with the next part (the delivery machine) once you get this working?