local player = game.Players.LocalPlayer local runService = game:GetService("RunService") local screenGui = Instance.new("ScreenGui") screenGui.ResetOnSpawn = false screenGui.Name = "CFrameViewer" screenGui.Parent = player:WaitForChild("PlayerGui") local frame = Instance.new("Frame") frame.Parent = screenGui frame.Size = UDim2.new(0, 400, 0, 220) frame.Position = UDim2.new(0, 20, 0, 20) frame.BackgroundColor3 = Color3.fromRGB(25, 25, 25) frame.BackgroundTransparency = 0.1 frame.BorderSizePixel = 0 frame.Active = true frame.Draggable = true local title = Instance.new("TextLabel") title.Parent = frame title.Size = UDim2.new(1, 0, 0, 30) title.BackgroundTransparency = 1 title.Text = "CFrame Viewer" title.Font = Enum.Font.GothamBold title.TextSize = 22 title.TextColor3 = Color3.new(1, 1, 1) local textLabel = Instance.new("TextLabel") textLabel.Parent = frame textLabel.Size = UDim2.new(1, -20, 1, -100) textLabel.Position = UDim2.new(0, 10, 0, 40) textLabel.BackgroundTransparency = 1 textLabel.TextColor3 = Color3.fromRGB(255, 255, 255) textLabel.Font = Enum.Font.Code textLabel.TextSize = 18 textLabel.TextXAlignment = Enum.TextXAlignment.Left textLabel.TextYAlignment = Enum.TextYAlignment.Top textLabel.Text = "" local copyButton = Instance.new("TextButton") copyButton.Parent = frame copyButton.Size = UDim2.new(0.5, -10, 0, 45) copyButton.Position = UDim2.new(0, 10, 1, -55) copyButton.BackgroundColor3 = Color3.fromRGB(0, 170, 255) copyButton.TextColor3 = Color3.new(1, 1, 1) copyButton.Text = "Copy CFrame" copyButton.Font = Enum.Font.GothamBold copyButton.TextSize = 18 copyButton.AutoButtonColor = true copyButton.BorderSizePixel = 0 Instance.new("UICorner", copyButton) -- Close Button local closeButton = Instance.new("TextButton") closeButton.Parent = frame closeButton.Size = UDim2.new(0.5, -10, 0, 45) closeButton.Position = UDim2.new(0.5, 0, 1, -55) closeButton.BackgroundColor3 = Color3.fromRGB(255, 50, 50) closeButton.TextColor3 = Color3.new(1, 1, 1) closeButton.Text = "Close" closeButton.Font = Enum.Font.GothamBold closeButton.TextSize = 18 closeButton.AutoButtonColor = true closeButton.BorderSizePixel = 0 Instance.new("UICorner", closeButton) -- Update Loop local lastCFrame = "" runService.RenderStepped:Connect(function() local char = player.Character local hrp = char and char:FindFirstChild("HumanoidRootPart") if not hrp then return end local x, y, z, m00, m01, m02, m10, m11, m12, m20, m21, m22 = hrp.CFrame:GetComponents() textLabel.Text = string.format( "Position:\nX: %.3f\nY: %.3f\nZ: %.3f\n\nRotation Matrix:\n%.9f, %.9f, %.9f\n%.9f, %.9f, %.9f\n%.9f, %.9f, %.9f", x, y, z, m00, m01, m02, m10, m11, m12, m20, m21, m22 ) lastCFrame = string.format( "CFrame.new(%.9f, %.9f, %.9f, %.9f, %.9f, %.9f, %.9f, %.9f, %.9f, %.9f, %.9f, %.9f)", x, y, z, m00, m01, m02, m10, m11, m12, m20, m21, m22 ) end) copyButton.MouseButton1Click:Connect(function() if lastCFrame and lastCFrame ~= "" then setclipboard(lastCFrame) copyButton.Text = "✅ Copied!" task.wait(1.5) copyButton.Text = "Copy CFrame" else copyButton.Text = "⚠ No data!" task.wait(1.5) copyButton.Text = "Copy CFrame" end end) closeButton.MouseButton1Click:Connect(function() screenGui:Destroy() end)