local Players = game:GetService("Players") local UIS = game:GetService("UserInputService") local player = Players.LocalPlayer local pg = player:WaitForChild("PlayerGui") local old = pg:FindFirstChild("CopyLocation") if old then old:Destroy() end local gui = Instance.new("ScreenGui") gui.Name = "CopyLocation" gui.ResetOnSpawn = false gui.DisplayOrder = 9999 gui.Parent = pg local frame = Instance.new("Frame") frame.Size = UDim2.fromOffset(300, 190) frame.Position = UDim2.new(0.5, -150, 0.5, -95) frame.BackgroundColor3 = Color3.fromRGB(24, 24, 34) frame.BorderSizePixel = 0 frame.Active = true frame.Parent = gui Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 12) local title = Instance.new("TextButton") title.Size = UDim2.new(1, 0, 0, 40) title.BackgroundColor3 = Color3.fromRGB(105, 55, 190) title.Text = "COPY LOCATION [-]" title.TextColor3 = Color3.new(1, 1, 1) title.Font = Enum.Font.GothamBold title.TextSize = 15 title.Parent = frame Instance.new("UICorner", title).CornerRadius = UDim.new(0, 10) local box = Instance.new("TextBox") box.Position = UDim2.fromOffset(10, 50) box.Size = UDim2.new(1, -20, 0, 55) box.BackgroundColor3 = Color3.fromRGB(42, 42, 55) box.TextColor3 = Color3.new(1, 1, 1) box.Text = "Your position will appear here" box.TextWrapped = true box.TextSize = 13 box.ClearTextOnFocus = false box.MultiLine = true box.Parent = frame Instance.new("UICorner", box).CornerRadius = UDim.new(0, 7) local btn = Instance.new("TextButton") btn.Position = UDim2.fromOffset(10, 120) btn.Size = UDim2.new(1, -20, 0, 42) btn.BackgroundColor3 = Color3.fromRGB(125, 65, 220) btn.TextColor3 = Color3.new(1, 1, 1) btn.Text = "SHOW CODE" btn.Font = Enum.Font.GothamBold btn.TextSize = 15 btn.Parent = frame Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 8) local minimized = false title.Activated:Connect(function() minimized = not minimized box.Visible = not minimized btn.Visible = not minimized frame.Size = minimized and UDim2.fromOffset(200, 40) or UDim2.fromOffset(300, 190) title.Text = minimized and "COPY LOCATION [+]" or "COPY LOCATION [-]" end) btn.Activated:Connect(function() local char = player.Character local root = char and char:FindFirstChild("HumanoidRootPart") if root then local p = root.Position box.Text = string.format( "Vector3.new(%.2f, %.2f, %.2f)", p.X, p.Y, p.Z ) else box.Text = "Character not found" end end) -- Drag support for PC and mobile local dragging = false local dragStart local startPos title.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = frame.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) UIS.InputChanged:Connect(function(input) if dragging and ( input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch ) then local delta = input.Position - dragStart frame.Position = UDim2.new( startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y ) end end)