local UserInputService = game:GetService("UserInputService") local Players = game:GetService("Players") local RunService = game:GetService("RunService") local player = Players.LocalPlayer local camera = workspace.CurrentCamera local gui = nil local connection = nil local isEnabled = false local function getSyncPairs(realObj, cloneObj, pairsTable) if realObj:IsA("BasePart") and cloneObj:IsA("BasePart") then cloneObj.Anchored = true table.insert(pairsTable, {real = realObj, clone = cloneObj}) end local realChildren = realObj:GetChildren() local cloneChildren = cloneObj:GetChildren() local cloneMap = {} for _, child in ipairs(cloneChildren) do local key = child.Name .. child.ClassName if not cloneMap[key] then cloneMap[key] = {} end table.insert(cloneMap[key], child) end for _, child in ipairs(realChildren) do local key = child.Name .. child.ClassName if cloneMap[key] and #cloneMap[key] > 0 then local matchedClone = table.remove(cloneMap[key], 1) getSyncPairs(child, matchedClone, pairsTable) end end end local function togglePerfectGreenScreen() isEnabled = not isEnabled if isEnabled then local character = player.Character if not character or not character:FindFirstChild("HumanoidRootPart") then isEnabled = false return end gui = Instance.new("ScreenGui") gui.Name = "PerfectChromaKey" gui.IgnoreGuiInset = true gui.ResetOnSpawn = false gui.DisplayOrder = 99999 local bg = Instance.new("Frame") bg.Size = UDim2.fromScale(1, 1) bg.BackgroundColor3 = Color3.fromRGB(0, 255, 0) bg.BorderSizePixel = 0 bg.Parent = gui local vpf = Instance.new("ViewportFrame") vpf.Size = UDim2.fromScale(1, 1) vpf.BackgroundTransparency = 1 vpf.Ambient = Color3.fromRGB(200, 200, 200) Keeps the character well-lit vpf.Parent = bg local vpfCamera = Instance.new("Camera") vpf.CurrentCamera = vpfCamera vpfCamera.Parent = vpf character.Archivable = true local clone = character:Clone() for _, desc in ipairs(clone:GetDescendants()) do if desc:IsA("Script") or desc:IsA("LocalScript") then desc:Destroy() end end local syncPairs = {} getSyncPairs(character, clone, syncPairs) clone.Parent = vpf gui.Parent = player:WaitForChild("PlayerGui") connection = RunService.RenderStepped:Connect(function() if not player.Character or not player.Character.Parent then togglePerfectGreenScreen() return end vpfCamera.CFrame = camera.CFrame vpfCamera.FieldOfView = camera.FieldOfView for _, pair in ipairs(syncPairs) do if pair.real and pair.clone and pair.real.Parent then pair.clone.CFrame = pair.real.CFrame end end end) else if connection then connection:Disconnect() connection = nil end if gui then gui:Destroy() gui = nil end end end UserInputService.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.KeyCode == Enum.KeyCode.F3 then togglePerfectGreenScreen() end end)