-- Place this LocalScript inside StarterPlayerScripts or StarterGui local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") -- Remove existing GUI if any if playerGui:FindFirstChild("WaypointTeleporterGui") then playerGui.WaypointTeleporterGui:Destroy() end -- Create ScreenGui local screenGui = Instance.new("ScreenGui") screenGui.Name = "WaypointTeleporterGui" screenGui.ResetOnSpawn = false screenGui.Parent = playerGui screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling -- Utility local function addUICorner(frame, radius) local corner = Instance.new("UICorner") corner.CornerRadius = radius or UDim.new(0, 8) corner.Parent = frame end local function addUIStroke(frame, color) local stroke = Instance.new("UIStroke") stroke.Color = color or Color3.fromRGB(255,0,0) stroke.Thickness = 2 stroke.Parent = frame end -- ========================= -- MAIN FRAME -- ========================= local mainFrame = Instance.new("Frame") mainFrame.Size = UDim2.new(0, 320, 0, 420) mainFrame.Position = UDim2.new(0, 50, 0, 70) mainFrame.BackgroundColor3 = Color3.fromRGB(25,0,0) mainFrame.BorderSizePixel = 0 mainFrame.Visible = false mainFrame.Parent = screenGui addUICorner(mainFrame) addUIStroke(mainFrame, Color3.fromRGB(255,0,0)) -- Title Bar local titleBar = Instance.new("Frame") titleBar.Size = UDim2.new(1,0,0,40) titleBar.BackgroundColor3 = Color3.fromRGB(120,0,0) titleBar.BorderSizePixel = 0 titleBar.Parent = mainFrame addUICorner(titleBar) local titleLabel = Instance.new("TextLabel") titleLabel.Size = UDim2.new(1,-40,1,0) titleLabel.Position = UDim2.new(0,10,0,0) titleLabel.BackgroundTransparency = 1 titleLabel.Text = "PRINCE WAYPOINT" titleLabel.Font = Enum.Font.Arcade titleLabel.TextSize = 22 titleLabel.TextColor3 = Color3.fromRGB(255,255,255) titleLabel.TextXAlignment = Enum.TextXAlignment.Left titleLabel.Parent = titleBar -- Close Button local closeButton = Instance.new("TextButton") closeButton.Size = UDim2.new(0,30,0,30) closeButton.Position = UDim2.new(1,-40,0,5) closeButton.BackgroundColor3 = Color3.fromRGB(60,0,0) closeButton.BorderSizePixel = 0 closeButton.Text = "✕" closeButton.Font = Enum.Font.Arcade closeButton.TextSize = 24 closeButton.TextColor3 = Color3.fromRGB(255,255,255) closeButton.Parent = titleBar addUICorner(closeButton, UDim.new(0,6)) addUIStroke(closeButton, Color3.fromRGB(255,0,0)) closeButton.MouseButton1Click:Connect(function() mainFrame.Visible = false end) -- Toggle Button local toggleButton = Instance.new("TextButton") toggleButton.Size = UDim2.new(0,50,0,50) toggleButton.Position = UDim2.new(0,20,1,-70) toggleButton.BackgroundColor3 = Color3.fromRGB(170,0,0) toggleButton.BorderSizePixel = 0 toggleButton.Text = "WP" toggleButton.Font = Enum.Font.Arcade toggleButton.TextSize = 24 toggleButton.TextColor3 = Color3.fromRGB(255,255,255) toggleButton.Parent = screenGui addUICorner(toggleButton, UDim.new(0,12)) addUIStroke(toggleButton, Color3.fromRGB(255,0,0)) toggleButton.MouseButton1Click:Connect(function() mainFrame.Visible = not mainFrame.Visible updateHistoryPosition() end) -- ========================= -- HISTORY FRAME (RIGHT SIDE) -- ========================= local historyFrame = Instance.new("Frame") historyFrame.Size = UDim2.new(0,260,0,420) historyFrame.BackgroundColor3 = Color3.fromRGB(35,0,0) historyFrame.BorderSizePixel = 0 historyFrame.Visible = false historyFrame.Parent = screenGui addUICorner(historyFrame) addUIStroke(historyFrame, Color3.fromRGB(255,0,0)) local historyTitle = Instance.new("TextLabel") historyTitle.Size = UDim2.new(1,0,0,30) historyTitle.BackgroundTransparency = 1 historyTitle.Text = "Waypoint History" historyTitle.Font = Enum.Font.Arcade historyTitle.TextSize = 20 historyTitle.TextColor3 = Color3.fromRGB(255,255,255) historyTitle.Parent = historyFrame local historyList = Instance.new("ScrollingFrame") historyList.Size = UDim2.new(1,-20,1,-40) historyList.Position = UDim2.new(0,10,0,35) historyList.BackgroundColor3 = Color3.fromRGB(60,0,0) historyList.BorderSizePixel = 0 historyList.CanvasSize = UDim2.new(0,0,0,0) historyList.ScrollBarThickness = 6 historyList.Parent = historyFrame local historyLayout = Instance.new("UIListLayout") historyLayout.Padding = UDim.new(0,6) historyLayout.Parent = historyList function updateHistoryPosition() historyFrame.Position = UDim2.new( 0, mainFrame.Position.X.Offset + mainFrame.AbsoluteSize.X + 10, 0, mainFrame.Position.Y.Offset ) end updateHistoryPosition() -- ========================= -- BUTTONS -- ========================= local buttonsFrame = Instance.new("Frame") buttonsFrame.Size = UDim2.new(1,-40,0,180) buttonsFrame.Position = UDim2.new(0,20,0,60) buttonsFrame.BackgroundTransparency = 1 buttonsFrame.Parent = mainFrame local buttonNames = { "Set Waypoint", "Goto Waypoint", "View Waypoint History", "Clear History" } local buttons = {} local listLayout = Instance.new("UIListLayout") listLayout.Padding = UDim.new(0,15) listLayout.Parent = buttonsFrame for _, name in ipairs(buttonNames) do local btn = Instance.new("TextButton") btn.Size = UDim2.new(1,0,0,40) btn.BackgroundColor3 = Color3.fromRGB(80,0,0) btn.BorderSizePixel = 0 btn.Text = name btn.Font = Enum.Font.Arcade btn.TextSize = 20 btn.TextColor3 = Color3.fromRGB(255,255,255) btn.Parent = buttonsFrame addUICorner(btn, UDim.new(0,10)) addUIStroke(btn, Color3.fromRGB(255,0,0)) buttons[name] = btn end -- ========================= -- WAYPOINT SYSTEM -- ========================= local waypoints = {} local currentWaypoint = nil local function createHistoryButton(wp) local btn = Instance.new("TextButton") btn.Size = UDim2.new(1,0,0,36) btn.BackgroundColor3 = Color3.fromRGB(120,0,0) btn.BorderSizePixel = 0 btn.Text = wp.name btn.Font = Enum.Font.Arcade btn.TextSize = 18 btn.TextColor3 = Color3.fromRGB(255,255,255) btn.Parent = historyList addUICorner(btn, UDim.new(0,8)) btn.MouseButton1Click:Connect(function() if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then player.Character.HumanoidRootPart.CFrame = CFrame.new(wp.position + Vector3.new(0,3,0)) currentWaypoint = wp end end) end local function updateHistoryUI() for _, child in pairs(historyList:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end for _, wp in ipairs(waypoints) do createHistoryButton(wp) end historyList.CanvasSize = UDim2.new(0,0,0,#waypoints * 42) end buttons["Set Waypoint"].MouseButton1Click:Connect(function() if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then local pos = player.Character.HumanoidRootPart.Position local wp = { name = "Waypoint "..(#waypoints+1), position = pos } table.insert(waypoints, wp) currentWaypoint = wp updateHistoryUI() end end) buttons["Goto Waypoint"].MouseButton1Click:Connect(function() if currentWaypoint and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then player.Character.HumanoidRootPart.CFrame = CFrame.new(currentWaypoint.position + Vector3.new(0,3,0)) end end) buttons["View Waypoint History"].MouseButton1Click:Connect(function() historyFrame.Visible = not historyFrame.Visible updateHistoryPosition() end) buttons["Clear History"].MouseButton1Click:Connect(function() waypoints = {} currentWaypoint = nil updateHistoryUI() end) -- ========================= -- DRAG SYSTEM -- ========================= local dragging = false local dragStart, startPos local function updatePosition(input) local delta = input.Position - dragStart local newPos = UDim2.new( startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y ) mainFrame.Position = newPos updateHistoryPosition() end mainFrame.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = true dragStart = input.Position startPos = mainFrame.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) UserInputService.InputChanged:Connect(function(input) if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then updatePosition(input) end end) mainFrame.Visible = false