-- LocalScript (StarterPlayerScripts) local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local player = Players.LocalPlayer local mouse = player:GetMouse() local teleportKey = Enum.KeyCode.LeftControl local teleportKeyHeld = false local waitingForKeyInput = false -- Create GUI local gui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui")) gui.Name = "TeleportGui" -- Create draggable frame local frame = Instance.new("Frame", gui) frame.Size = UDim2.new(0, 220, 0, 70) frame.Position = UDim2.new(0.5, -110, 0, 50) frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) frame.BackgroundTransparency = 0.2 frame.Active = true frame.Draggable = true -- Button inside the frame local button = Instance.new("TextButton", frame) button.Size = UDim2.new(1, -20, 1, -20) button.Position = UDim2.new(0, 10, 0, 10) button.Text = "Set Teleport Key" button.BackgroundColor3 = Color3.fromRGB(50, 50, 50) button.TextColor3 = Color3.new(1, 1, 1) button.Font = Enum.Font.SourceSansBold button.TextSize = 24 -- Update button label local function updateButtonLabel() button.Text = "Key: " .. teleportKey.Name end -- Handle setting new keybind button.MouseButton1Click:Connect(function() button.Text = "Press any key..." waitingForKeyInput = true end) UserInputService.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if waitingForKeyInput and input.UserInputType == Enum.UserInputType.Keyboard then teleportKey = input.KeyCode waitingForKeyInput = false updateButtonLabel() return end if input.KeyCode == teleportKey then teleportKeyHeld = true end end) UserInputService.InputEnded:Connect(function(input) if input.KeyCode == teleportKey then teleportKeyHeld = false end end) -- Teleport on Left Click while holding the key mouse.Button1Down:Connect(function() if not teleportKeyHeld then return end local character = player.Character if not character or not character:FindFirstChild("HumanoidRootPart") then return end local targetPosition = mouse.Hit.Position + Vector3.new(0, 3, 0) character:MoveTo(targetPosition) end) -- Initial button label updateButtonLabel()