local Players = game:GetService("Players") local LocalPlayer = Players.LocalPlayer local PlayerGui = LocalPlayer:WaitForChild("PlayerGui") -- Remove old GUI if re-running if PlayerGui:FindFirstChild("TeleportHubGui") then PlayerGui.TeleportHubGui:Destroy() end -- Create ScreenGui local screenGui = Instance.new("ScreenGui") screenGui.Name = "TeleportHubGui" screenGui.ResetOnSpawn = false screenGui.Parent = PlayerGui -- Toggle Button ("TELEPORT HUB") local openButton = Instance.new("TextButton") openButton.Name = "OpenButton" openButton.Size = UDim2.new(0, 160, 0, 42) openButton.Position = UDim2.new(0, 16, 0.5, -21) openButton.BackgroundColor3 = Color3.fromRGB(30, 30, 38) openButton.TextColor3 = Color3.fromRGB(255, 255, 255) openButton.Font = Enum.Font.GothamBold openButton.TextSize = 15 openButton.Text = "TELEPORT HUB" openButton.Parent = screenGui local openCorner = Instance.new("UICorner") openCorner.CornerRadius = UDim.new(0, 8) openCorner.Parent = openButton -- Main Hub Window local mainFrame = Instance.new("Frame") mainFrame.Name = "MainFrame" mainFrame.Size = UDim2.new(0, 280, 0, 340) mainFrame.Position = UDim2.new(0.5, -140, 0.5, -170) mainFrame.BackgroundColor3 = Color3.fromRGB(24, 24, 30) mainFrame.Visible = false mainFrame.Active = true mainFrame.Draggable = true mainFrame.Parent = screenGui local mainCorner = Instance.new("UICorner") mainCorner.CornerRadius = UDim.new(0, 10) mainCorner.Parent = mainFrame -- Header Title local titleLabel = Instance.new("TextLabel") titleLabel.Size = UDim2.new(1, -44, 0, 42) titleLabel.Position = UDim2.new(0, 12, 0, 0) titleLabel.BackgroundTransparency = 1 titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255) titleLabel.Font = Enum.Font.GothamBold titleLabel.TextSize = 16 titleLabel.TextXAlignment = Enum.TextXAlignment.Left titleLabel.Text = "TELEPORT HUB" titleLabel.Parent = mainFrame -- Close Button local closeButton = Instance.new("TextButton") closeButton.Size = UDim2.new(0, 30, 0, 30) closeButton.Position = UDim2.new(1, -36, 0, 6) closeButton.BackgroundColor3 = Color3.fromRGB(200, 55, 55) closeButton.TextColor3 = Color3.fromRGB(255, 255, 255) closeButton.Font = Enum.Font.GothamBold closeButton.TextSize = 14 closeButton.Text = "X" closeButton.Parent = mainFrame local closeCorner = Instance.new("UICorner") closeCorner.CornerRadius = UDim.new(0, 6) closeCorner.Parent = closeButton -- Scrolling Player List local playerList = Instance.new("ScrollingFrame") playerList.Size = UDim2.new(1, -20, 1, -54) playerList.Position = UDim2.new(0, 10, 0, 44) playerList.BackgroundColor3 = Color3.fromRGB(18, 18, 22) playerList.BorderSizePixel = 0 playerList.ScrollBarThickness = 6 playerList.CanvasSize = UDim2.new(0, 0, 0, 0) playerList.Parent = mainFrame local listCorner = Instance.new("UICorner") listCorner.CornerRadius = UDim.new(0, 8) listCorner.Parent = playerList local listLayout = Instance.new("UIListLayout") listLayout.Padding = UDim.new(0, 6) listLayout.SortOrder = Enum.SortOrder.Name listLayout.Parent = playerList local listPadding = Instance.new("UIPadding") listPadding.PaddingTop = UDim.new(0, 6) listPadding.PaddingBottom = UDim.new(0, 6) listPadding.PaddingLeft = UDim.new(0, 6) listPadding.PaddingRight = UDim.new(0, 6) listPadding.Parent = playerList -- Teleport Function local function teleportToPlayer(targetPlayer) local myChar = LocalPlayer.Character local targetChar = targetPlayer.Character local myRoot = myChar and myChar:FindFirstChild("HumanoidRootPart") local targetRoot = targetChar and targetChar:FindFirstChild("HumanoidRootPart") if myRoot and targetRoot then myRoot.CFrame = targetRoot.CFrame * CFrame.new(0, 0, 4) end end -- Update Canvas Size local function updateCanvas() task.wait() playerList.CanvasSize = UDim2.new(0, 0, 0, listLayout.AbsoluteContentSize.Y + 12) end -- Rebuild Player Buttons local function refreshPlayers() for _, child in ipairs(playerList:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end for _, player in ipairs(Players:GetPlayers()) do if player ~= LocalPlayer then local btn = Instance.new("TextButton") btn.Name = player.Name btn.Size = UDim2.new(1, 0, 0, 36) btn.BackgroundColor3 = Color3.fromRGB(45, 45, 58) btn.TextColor3 = Color3.fromRGB(255, 255, 255) btn.Font = Enum.Font.GothamSemibold btn.TextSize = 14 btn.Text = player.DisplayName .. " (@" .. player.Name .. ")" btn.Parent = playerList local btnCorner = Instance.new("UICorner") btnCorner.CornerRadius = UDim.new(0, 6) btnCorner.Parent = btn btn.MouseButton1Click:Connect(function() teleportToPlayer(player) end) end end updateCanvas() end -- Button & Player Events openButton.MouseButton1Click:Connect(function() mainFrame.Visible = not mainFrame.Visible if mainFrame.Visible then refreshPlayers() end end) closeButton.MouseButton1Click:Connect(function() mainFrame.Visible = false end) Players.PlayerAdded:Connect(function() if mainFrame.Visible then refreshPlayers() end end) Players.PlayerRemoving:Connect(function() if mainFrame.Visible then refreshPlayers() end end)