-- Services local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local RunService = game:GetService("RunService") local TweenService = game:GetService("TweenService") local CoreGui = game:GetService("CoreGui") local Workspace = game:GetService("Workspace") local localPlayer = Players.LocalPlayer -- Track active instances and connections for full cleanup on exit local connections = {} local createdParts = {} local screenGui = nil -------------------------------------------------------------------------------- -- 1. GUI CREATION & STYLING -------------------------------------------------------------------------------- screenGui = Instance.new("ScreenGui") screenGui.Name = "TeleportGui_" .. math.random(1000, 9999) screenGui.ResetOnSpawn = false if gethui then screenGui.Parent = gethui() elseif syn and syn.protect_gui then syn.protect_gui(screenGui) screenGui.Parent = CoreGui elseif CoreGui then screenGui.Parent = CoreGui else screenGui.Parent = localPlayer:WaitForChild("PlayerGui") end -- Main Frame local mainFrame = Instance.new("Frame") mainFrame.Name = "MainFrame" mainFrame.Size = UDim2.new(0, 240, 0, 240) mainFrame.Position = UDim2.new(0.5, -120, 0.4, -120) mainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 25) mainFrame.BorderSizePixel = 0 mainFrame.ClipsDescendants = true mainFrame.Active = true mainFrame.Parent = screenGui local mainCorner = Instance.new("UICorner") mainCorner.CornerRadius = UDim.new(0, 10) mainCorner.Parent = mainFrame local uiStroke = Instance.new("UIStroke") uiStroke.Thickness = 2 uiStroke.Color = Color3.fromRGB(80, 140, 240) uiStroke.Parent = mainFrame -- Title Bar (Drag Container) local titleBar = Instance.new("Frame") titleBar.Name = "TitleBar" titleBar.Size = UDim2.new(1, 0, 0, 30) titleBar.BackgroundColor3 = Color3.fromRGB(35, 35, 35) titleBar.BorderSizePixel = 0 titleBar.Active = true titleBar.ZIndex = 2 titleBar.Parent = mainFrame local titleCorner = Instance.new("UICorner") titleCorner.CornerRadius = UDim.new(0, 10) titleCorner.Parent = titleBar local titleText = Instance.new("TextLabel") titleText.Size = UDim2.new(1, -70, 1, 0) titleText.Position = UDim2.new(0, 10, 0, 0) titleText.BackgroundTransparency = 1 titleText.Text = "Teleport Menu" titleText.TextColor3 = Color3.fromRGB(255, 255, 255) titleText.TextSize = 14 titleText.Font = Enum.Font.GothamBold titleText.TextXAlignment = Enum.TextXAlignment.Left titleText.ZIndex = 3 titleText.Parent = titleBar -- Minimize Button (-) local minimizeBtn = Instance.new("TextButton") minimizeBtn.Name = "MinimizeButton" minimizeBtn.Size = UDim2.new(0, 22, 0, 22) minimizeBtn.Position = UDim2.new(1, -52, 0, 4) minimizeBtn.BackgroundColor3 = Color3.fromRGB(55, 55, 55) minimizeBtn.Text = "-" minimizeBtn.TextColor3 = Color3.fromRGB(255, 255, 255) minimizeBtn.Font = Enum.Font.GothamBold minimizeBtn.TextSize = 16 minimizeBtn.ZIndex = 4 minimizeBtn.Parent = titleBar local minCorner = Instance.new("UICorner") minCorner.CornerRadius = UDim.new(0, 6) minCorner.Parent = minimizeBtn -- Floating Draggable Circle Minimize Button ("GUI") local minimizeBtnCircle = Instance.new("TextButton") minimizeBtnCircle.Name = "MinimizeCircleButton" minimizeBtnCircle.Size = UDim2.new(0, 50, 0, 50) minimizeBtnCircle.Position = UDim2.new(0.05, 0, 0.4, 0) minimizeBtnCircle.BackgroundColor3 = Color3.fromRGB(35, 35, 35) minimizeBtnCircle.Text = "GUI" minimizeBtnCircle.TextColor3 = Color3.fromRGB(255, 255, 255) minimizeBtnCircle.Font = Enum.Font.GothamBold minimizeBtnCircle.TextSize = 14 minimizeBtnCircle.Visible = false minimizeBtnCircle.Active = true minimizeBtnCircle.ZIndex = 10 minimizeBtnCircle.Parent = screenGui local circleCorner = Instance.new("UICorner") circleCorner.CornerRadius = UDim.new(1, 0) circleCorner.Parent = minimizeBtnCircle local circleStroke = Instance.new("UIStroke") circleStroke.Thickness = 2 circleStroke.Color = Color3.fromRGB(80, 140, 240) circleStroke.Parent = minimizeBtnCircle -- Exit Button (X) local exitBtn = Instance.new("TextButton") exitBtn.Name = "ExitButton" exitBtn.Size = UDim2.new(0, 22, 0, 22) exitBtn.Position = UDim2.new(1, -26, 0, 4) exitBtn.BackgroundColor3 = Color3.fromRGB(200, 50, 50) exitBtn.Text = "X" exitBtn.TextColor3 = Color3.fromRGB(255, 255, 255) exitBtn.Font = Enum.Font.GothamBold exitBtn.TextSize = 12 exitBtn.ZIndex = 4 exitBtn.Parent = titleBar local exitCorner = Instance.new("UICorner") exitCorner.CornerRadius = UDim.new(0, 6) exitCorner.Parent = exitBtn -- Scrollable Content Frame local contentFrame = Instance.new("ScrollingFrame") contentFrame.Name = "ContentFrame" contentFrame.Size = UDim2.new(1, 0, 1, -30) contentFrame.Position = UDim2.new(0, 0, 0, 30) contentFrame.BackgroundTransparency = 1 contentFrame.BorderSizePixel = 0 contentFrame.ScrollBarThickness = 4 contentFrame.ScrollBarImageColor3 = Color3.fromRGB(100, 100, 100) contentFrame.CanvasSize = UDim2.new(0, 0, 0, 0) contentFrame.AutomaticCanvasSize = Enum.AutomaticSize.Y contentFrame.Parent = mainFrame local listLayout = Instance.new("UIListLayout") listLayout.Padding = UDim.new(0, 8) listLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center listLayout.SortOrder = Enum.SortOrder.LayoutOrder listLayout.Parent = contentFrame local listPadding = Instance.new("UIPadding") listPadding.PaddingTop = UDim.new(0, 10) listPadding.PaddingBottom = UDim.new(0, 10) listPadding.Parent = contentFrame -- Teleport Header Label local teleportHeader = Instance.new("TextLabel") teleportHeader.Name = "TeleportHeader" teleportHeader.Size = UDim2.new(0.9, 0, 0, 20) teleportHeader.LayoutOrder = 0 teleportHeader.BackgroundTransparency = 1 teleportHeader.Text = "--- Teleport ---" teleportHeader.TextColor3 = Color3.fromRGB(180, 180, 180) teleportHeader.Font = Enum.Font.GothamBold teleportHeader.TextSize = 13 teleportHeader.Parent = contentFrame -------------------------------------------------------------------------------- -- 2. DRAGGING LOGIC (MAIN FRAME & CIRCLE) -------------------------------------------------------------------------------- local draggingMain = false local dragStartMain = nil local startPosMain = nil local titleInputConn = titleBar.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then draggingMain = true dragStartMain = input.Position startPosMain = mainFrame.Position end end) table.insert(connections, titleInputConn) local draggingCircle = false local dragStartCircle = nil local startPosCircle = nil local circleDragged = false local circleInputConn = minimizeBtnCircle.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then draggingCircle = true circleDragged = false dragStartCircle = input.Position startPosCircle = minimizeBtnCircle.Position end end) table.insert(connections, circleInputConn) local dragGlobalConn = UserInputService.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then if draggingMain then local delta = input.Position - dragStartMain mainFrame.Position = UDim2.new(startPosMain.X.Scale, startPosMain.X.Offset + delta.X, startPosMain.Y.Scale, startPosMain.Y.Offset + delta.Y) elseif draggingCircle then local delta = input.Position - dragStartCircle if delta.Magnitude > 3 then circleDragged = true end minimizeBtnCircle.Position = UDim2.new(startPosCircle.X.Scale, startPosCircle.X.Offset + delta.X, startPosCircle.Y.Scale, startPosCircle.Y.Offset + delta.Y) end end end) table.insert(connections, dragGlobalConn) local dragEndConn = UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then draggingMain = false draggingCircle = false end end) table.insert(connections, dragEndConn) -------------------------------------------------------------------------------- -- 3. TELEPORT & MARKER LOGIC -------------------------------------------------------------------------------- local locations = { { Name = "Gas Station", Position = Vector3.new(104.44, 142.53, -10.62) }, { Name = "Firearms", Position = Vector3.new(139.66, 142.08, -311.16) }, { Name = "Ammo", Position = Vector3.new(512.71, 144.46, 68.26) } } local function teleportTo(position) local character = localPlayer.Character if character and character:FindFirstChild("HumanoidRootPart") then character:PivotTo(CFrame.new(position + Vector3.new(0, 3, 0))) end end local function createMarkerAndButton(locData, index) -- 1. Create floating 3D world text marker local markerPart = Instance.new("Part") markerPart.Name = locData.Name .. "Marker" markerPart.Size = Vector3.new(1, 1, 1) markerPart.Position = locData.Position markerPart.Transparency = 1 markerPart.Anchored = true markerPart.CanCollide = false markerPart.Parent = Workspace table.insert(createdParts, markerPart) local billboardGui = Instance.new("BillboardGui") billboardGui.Name = locData.Name .. "Label" billboardGui.Adornee = markerPart billboardGui.Size = UDim2.new(0, 200, 0, 50) billboardGui.StudsOffset = Vector3.new(0, 3, 0) billboardGui.AlwaysOnTop = true billboardGui.Parent = markerPart local textLabel = Instance.new("TextLabel") textLabel.Size = UDim2.new(1, 0, 1, 0) textLabel.BackgroundTransparency = 1 textLabel.Text = locData.Name textLabel.TextColor3 = Color3.fromRGB(255, 255, 0) textLabel.TextStrokeTransparency = 0 textLabel.TextStrokeColor3 = Color3.fromRGB(0, 0, 0) textLabel.TextSize = 18 textLabel.Font = Enum.Font.GothamBold textLabel.Parent = billboardGui -- 2. Create Teleport Button inside UI local tpBtn = Instance.new("TextButton") tpBtn.Name = locData.Name .. "Button" tpBtn.Size = UDim2.new(0.9, 0, 0, 30) tpBtn.LayoutOrder = index tpBtn.BackgroundColor3 = Color3.fromRGB(50, 50, 50) tpBtn.Text = locData.Name tpBtn.TextColor3 = Color3.fromRGB(255, 255, 255) tpBtn.Font = Enum.Font.GothamSemibold tpBtn.TextSize = 13 tpBtn.Parent = contentFrame local btnCorner = Instance.new("UICorner") btnCorner.CornerRadius = UDim.new(0, 8) btnCorner.Parent = tpBtn local clickConn = tpBtn.MouseButton1Click:Connect(function() teleportTo(locData.Position) end) table.insert(connections, clickConn) end -- Generate all markers and buttons for i, loc in ipairs(locations) do createMarkerAndButton(loc, i) end -------------------------------------------------------------------------------- -- 4. MINIMIZE & EXIT LOGIC -------------------------------------------------------------------------------- minimizeBtn.MouseButton1Click:Connect(function() mainFrame.Visible = false minimizeBtnCircle.Visible = true end) minimizeBtnCircle.MouseButton1Click:Connect(function() if not circleDragged then mainFrame.Visible = true minimizeBtnCircle.Visible = false end end) exitBtn.MouseButton1Click:Connect(function() -- Disconnect all active UI connections for _, conn in ipairs(connections) do if conn then conn:Disconnect() end end -- Destroy all created 3D marker parts in workspace for _, part in ipairs(createdParts) do if part then part:Destroy() end end -- Destroy the entire GUI if screenGui then screenGui:Destroy() end end) print("Successfully loaded Teleport Menu script!")