local UIS = game:GetService("UserInputService") local TweenService = game:GetService("TweenService") local Players = game:GetService("Players") local hasFileApis = (type(writefile) == "function") and (type(loadfile) == "function") local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "LuaCompress_" .. tostring(math.random(10000, 99999)) ScreenGui.ResetOnSpawn = false ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling ScreenGui.Parent = Players.LocalPlayer:WaitForChild("PlayerGui") local mainframe = Instance.new("Frame") mainframe.Name = "Main_" .. tostring(math.random(10000, 99999)) mainframe.Parent = ScreenGui mainframe.BackgroundColor3 = Color3.fromRGB(35, 35, 35) mainframe.Size = UDim2.new(0, 470, 0, 384) mainframe.Position = UDim2.new(0.5, -235, 0.5, -192) mainframe.BorderSizePixel = 0 mainframe.Active = true local mainStroke = Instance.new("UIStroke") mainStroke.Parent = mainframe mainStroke.Color = Color3.fromRGB(58, 58, 58) mainStroke.Thickness = 1 local topBar = Instance.new("Frame") topBar.Parent = mainframe topBar.Size = UDim2.new(1, 0, 0, 30) topBar.Position = UDim2.new(0, 0, 0, 0) topBar.BackgroundColor3 = Color3.fromRGB(25, 25, 25) topBar.BorderSizePixel = 0 local titleLabel = Instance.new("TextLabel") titleLabel.Parent = topBar titleLabel.Text = "LuaCompress 1.0.0" titleLabel.Size = UDim2.new(1, -40, 1, 0) titleLabel.Position = UDim2.new(0, 10, 0, 0) titleLabel.BackgroundTransparency = 1 titleLabel.TextColor3 = Color3.fromRGB(205, 205, 205) titleLabel.Font = Enum.Font.Code titleLabel.TextSize = 14 titleLabel.TextXAlignment = Enum.TextXAlignment.Left local xButton = Instance.new("TextButton") xButton.Parent = topBar xButton.Text = "x" xButton.Size = UDim2.new(0, 30, 0, 30) xButton.Position = UDim2.new(1, -30, 0, 0) xButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0) xButton.TextColor3 = Color3.fromRGB(255, 255, 255) xButton.Font = Enum.Font.Code xButton.TextSize = 15 xButton.BorderSizePixel = 0 local inputHeader = Instance.new("TextLabel") inputHeader.Parent = mainframe inputHeader.Text = "INPUT SCRIPT" inputHeader.Size = UDim2.new(0.45, 0, 0, 14) inputHeader.Position = UDim2.new(0, 12, 0, 35) inputHeader.BackgroundTransparency = 1 inputHeader.TextColor3 = Color3.fromRGB(145, 145, 145) inputHeader.Font = Enum.Font.Code inputHeader.TextSize = 11 inputHeader.TextXAlignment = Enum.TextXAlignment.Left local statusLabel = Instance.new("TextLabel") statusLabel.Parent = mainframe statusLabel.Text = "Ready" statusLabel.Size = UDim2.new(0.55, -12, 0, 14) statusLabel.Position = UDim2.new(0.45, 0, 0, 35) statusLabel.BackgroundTransparency = 1 statusLabel.TextColor3 = Color3.fromRGB(160, 160, 160) statusLabel.Font = Enum.Font.Code statusLabel.TextSize = 11 statusLabel.TextXAlignment = Enum.TextXAlignment.Right local inputFrame = Instance.new("Frame") inputFrame.Parent = mainframe inputFrame.Position = UDim2.new(0, 12, 0, 51) inputFrame.Size = UDim2.new(1, -24, 0, 114) inputFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 20) inputFrame.BorderSizePixel = 0 inputFrame.ClipsDescendants = true local inputStroke = Instance.new("UIStroke") inputStroke.Parent = inputFrame inputStroke.Color = Color3.fromRGB(48, 48, 48) inputStroke.Thickness = 1 local inputBox = Instance.new("TextBox") inputBox.Parent = inputFrame inputBox.Size = UDim2.new(1, -10, 1, -8) inputBox.Position = UDim2.new(0, 5, 0, 4) inputBox.BackgroundTransparency = 1 inputBox.TextColor3 = Color3.fromRGB(220, 220, 220) inputBox.PlaceholderText = "Fill Script Here..." inputBox.PlaceholderColor3 = Color3.fromRGB(115, 115, 115) inputBox.ClearTextOnFocus = false inputBox.TextWrapped = true inputBox.TextXAlignment = Enum.TextXAlignment.Left inputBox.TextYAlignment = Enum.TextYAlignment.Top inputBox.TextSize = 12 inputBox.MultiLine = true inputBox.Font = Enum.Font.Code inputBox.RichText = false inputBox.Text = "" inputBox.BorderSizePixel = 0 local outputHeader = Instance.new("TextLabel") outputHeader.Parent = mainframe outputHeader.Text = "COMPRESSED OUTPUT" outputHeader.Size = UDim2.new(0.5, 0, 0, 14) outputHeader.Position = UDim2.new(0, 12, 0, 171) outputHeader.BackgroundTransparency = 1 outputHeader.TextColor3 = Color3.fromRGB(145, 145, 145) outputHeader.Font = Enum.Font.Code outputHeader.TextSize = 11 outputHeader.TextXAlignment = Enum.TextXAlignment.Left local sizeLabel = Instance.new("TextLabel") sizeLabel.Parent = mainframe sizeLabel.Text = "0 bytes" sizeLabel.Size = UDim2.new(0.5, -12, 0, 14) sizeLabel.Position = UDim2.new(0.5, 0, 0, 171) sizeLabel.BackgroundTransparency = 1 sizeLabel.TextColor3 = Color3.fromRGB(135, 135, 135) sizeLabel.Font = Enum.Font.Code sizeLabel.TextSize = 11 sizeLabel.TextXAlignment = Enum.TextXAlignment.Right local outputFrame = Instance.new("Frame") outputFrame.Parent = mainframe outputFrame.Position = UDim2.new(0, 12, 0, 187) outputFrame.Size = UDim2.new(1, -24, 0, 110) outputFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 20) outputFrame.BorderSizePixel = 0 outputFrame.ClipsDescendants = true local outputStroke = Instance.new("UIStroke") outputStroke.Parent = outputFrame outputStroke.Color = Color3.fromRGB(48, 48, 48) outputStroke.Thickness = 1 local outputBox = Instance.new("TextBox") outputBox.Parent = outputFrame outputBox.Size = UDim2.new(1, -10, 1, -8) outputBox.Position = UDim2.new(0, 5, 0, 4) outputBox.BackgroundTransparency = 1 outputBox.TextColor3 = Color3.fromRGB(220, 220, 220) outputBox.PlaceholderText = "Compressed Output Will Appear Here..." outputBox.PlaceholderColor3 = Color3.fromRGB(115, 115, 115) outputBox.ClearTextOnFocus = false outputBox.TextWrapped = true outputBox.TextXAlignment = Enum.TextXAlignment.Left outputBox.TextYAlignment = Enum.TextYAlignment.Top outputBox.TextSize = 12 outputBox.MultiLine = true outputBox.Font = Enum.Font.Code outputBox.RichText = false outputBox.Text = "" outputBox.BorderSizePixel = 0 pcall(function() outputBox.TextEditable = false end) local clearButton = Instance.new("TextButton") clearButton.Parent = mainframe clearButton.Text = "Clear" clearButton.Size = UDim2.new(0, 92, 0, 30) clearButton.Position = UDim2.new(0, 12, 0, 305) clearButton.BackgroundColor3 = Color3.fromRGB(45, 45, 45) clearButton.TextColor3 = Color3.fromRGB(220, 220, 220) clearButton.Font = Enum.Font.SourceSansSemibold clearButton.TextSize = 15 clearButton.BorderSizePixel = 0 local copyButton = Instance.new("TextButton") copyButton.Parent = mainframe copyButton.Text = "Copy" copyButton.Size = UDim2.new(0, 92, 0, 30) copyButton.Position = UDim2.new(0, 110, 0, 305) copyButton.BackgroundColor3 = Color3.fromRGB(45, 45, 45) copyButton.TextColor3 = Color3.fromRGB(220, 220, 220) copyButton.Font = Enum.Font.SourceSansSemibold copyButton.TextSize = 15 copyButton.BorderSizePixel = 0 local encodeButton = Instance.new("TextButton") encodeButton.Parent = mainframe encodeButton.Text = "Encode" encodeButton.Size = UDim2.new(1, -220, 0, 30) encodeButton.Position = UDim2.new(0, 208, 0, 305) encodeButton.BackgroundColor3 = Color3.fromRGB(58, 58, 58) encodeButton.TextColor3 = Color3.fromRGB(235, 235, 235) encodeButton.Font = Enum.Font.SourceSansBold encodeButton.TextSize = 16 encodeButton.BorderSizePixel = 0 local encodeStroke = Instance.new("UIStroke") encodeStroke.Parent = encodeButton encodeStroke.Color = Color3.fromRGB(85, 85, 85) encodeStroke.Thickness = 1 local exportToggleButton = Instance.new("TextButton") exportToggleButton.Parent = mainframe exportToggleButton.Text = "Export To File" exportToggleButton.Size = UDim2.new(1, -24, 0, 30) exportToggleButton.Position = UDim2.new(0, 12, 0, 342) exportToggleButton.BackgroundColor3 = Color3.fromRGB(42, 42, 42) exportToggleButton.TextColor3 = Color3.fromRGB(220, 220, 220) exportToggleButton.Font = Enum.Font.Code exportToggleButton.TextSize = 13 exportToggleButton.BorderSizePixel = 0 local exportBtnStroke = Instance.new("UIStroke") exportBtnStroke.Parent = exportToggleButton exportBtnStroke.Color = Color3.fromRGB(65, 65, 65) exportBtnStroke.Thickness = 1 if not hasFileApis then exportToggleButton.Active = false exportToggleButton.AutoButtonColor = false exportToggleButton.TextColor3 = Color3.fromRGB(115, 115, 115) local cageContainer = Instance.new("Frame") cageContainer.Name = "FileApiCage" cageContainer.Parent = exportToggleButton cageContainer.Size = UDim2.new(1, 0, 1, 0) cageContainer.Position = UDim2.new(0, 0, 0, 0) cageContainer.BackgroundColor3 = Color3.fromRGB(14, 14, 14) cageContainer.BackgroundTransparency = 0.28 cageContainer.BorderSizePixel = 0 cageContainer.ClipsDescendants = true cageContainer.ZIndex = 5 local cageStroke = Instance.new("UIStroke") cageStroke.Parent = cageContainer cageStroke.Color = Color3.fromRGB(175, 55, 55) cageStroke.Thickness = 1.5 local barCount = 12 local vBars = {} for b = 1, barCount do local bar = Instance.new("Frame") bar.Parent = cageContainer bar.Size = UDim2.new(0, 3, 1, 4) bar.Position = UDim2.new(b / (barCount + 1), -1, -1.2, 0) bar.BackgroundColor3 = Color3.fromRGB(120, 120, 128) bar.BorderSizePixel = 0 bar.ZIndex = 6 vBars[b] = bar end local hBarTop = Instance.new("Frame") hBarTop.Parent = cageContainer hBarTop.Size = UDim2.new(1, 0, 0, 3) hBarTop.Position = UDim2.new(-1, 0, 0, 4) hBarTop.BackgroundColor3 = Color3.fromRGB(95, 95, 102) hBarTop.BorderSizePixel = 0 hBarTop.ZIndex = 7 local hBarBottom = Instance.new("Frame") hBarBottom.Parent = cageContainer hBarBottom.Size = UDim2.new(1, 0, 0, 3) hBarBottom.Position = UDim2.new(1, 0, 1, -7) hBarBottom.BackgroundColor3 = Color3.fromRGB(95, 95, 102) hBarBottom.BorderSizePixel = 0 hBarBottom.ZIndex = 7 local lockBadge = Instance.new("TextLabel") lockBadge.Parent = cageContainer lockBadge.Size = UDim2.new(0, 174, 0, 16) lockBadge.Position = UDim2.new(0.5, -87, 0.5, -8) lockBadge.BackgroundColor3 = Color3.fromRGB(25, 15, 15) lockBadge.TextColor3 = Color3.fromRGB(235, 95, 95) lockBadge.Font = Enum.Font.Code lockBadge.TextSize = 10 lockBadge.Text = "[CAGED: NO WRITE/LOADFILE]" lockBadge.BorderSizePixel = 0 lockBadge.ZIndex = 8 local lockStroke = Instance.new("UIStroke") lockStroke.Parent = lockBadge lockStroke.Color = Color3.fromRGB(175, 55, 55) lockStroke.Thickness = 1 task.spawn(function() for step = 1, 16 do local alpha = step / 16 local ease = 1 - ((1 - alpha) ^ 3) for b = 1, barCount do local delayFactor = math.clamp((alpha * 1.35) - ((b - 1) * 0.025), 0, 1) local barEase = 1 - ((1 - delayFactor) ^ 3) vBars[b].Position = UDim2.new(b / (barCount + 1), -1, -1.2 + (1.2 * barEase), -2) end hBarTop.Position = UDim2.new(-1 + ease, 0, 0, 4) hBarBottom.Position = UDim2.new(1 - ease, 0, 1, -7) task.wait(0.016) end for shake = 1, 6 do local offset = (shake % 2 == 0) and 2 or -2 cageContainer.Position = UDim2.new(0, offset, 0, 0) task.wait(0.025) end cageContainer.Position = UDim2.new(0, 0, 0, 0) local tickCount = 0 while ScreenGui and ScreenGui.Parent do tickCount = tickCount + 1 local activeIdx = (tickCount % barCount) + 1 for b = 1, barCount do if b == activeIdx then vBars[b].BackgroundColor3 = Color3.fromRGB(190, 190, 200) else vBars[b].BackgroundColor3 = Color3.fromRGB(115, 115, 122) end end if tickCount % 45 == 0 then lockBadge.Position = UDim2.new(0.5, -85, 0.5, -8) task.wait(0.04) lockBadge.Position = UDim2.new(0.5, -89, 0.5, -8) task.wait(0.04) lockBadge.Position = UDim2.new(0.5, -87, 0.5, -8) end task.wait(0.06) end end) end local exportFrame = Instance.new("Frame") exportFrame.Name = "ExportPanel_" .. tostring(math.random(10000, 99999)) exportFrame.Parent = mainframe exportFrame.BackgroundColor3 = Color3.fromRGB(35, 35, 35) exportFrame.Size = UDim2.new(0, 245, 0, 215) exportFrame.Position = UDim2.new(1, 6, 0, 0) exportFrame.BorderSizePixel = 0 exportFrame.Visible = false local exportFrameStroke = Instance.new("UIStroke") exportFrameStroke.Parent = exportFrame exportFrameStroke.Color = Color3.fromRGB(58, 58, 58) exportFrameStroke.Thickness = 1 local exportTopBar = Instance.new("Frame") exportTopBar.Parent = exportFrame exportTopBar.Size = UDim2.new(1, 0, 0, 30) exportTopBar.Position = UDim2.new(0, 0, 0, 0) exportTopBar.BackgroundColor3 = Color3.fromRGB(25, 25, 25) exportTopBar.BorderSizePixel = 0 local exportTitleLabel = Instance.new("TextLabel") exportTitleLabel.Parent = exportTopBar exportTitleLabel.Text = "Export To Fille" exportTitleLabel.Size = UDim2.new(1, -38, 1, 0) exportTitleLabel.Position = UDim2.new(0, 10, 0, 0) exportTitleLabel.BackgroundTransparency = 1 exportTitleLabel.TextColor3 = Color3.fromRGB(205, 205, 205) exportTitleLabel.Font = Enum.Font.Code exportTitleLabel.TextSize = 14 exportTitleLabel.TextXAlignment = Enum.TextXAlignment.Left local exportCloseButton = Instance.new("TextButton") exportCloseButton.Parent = exportTopBar exportCloseButton.Text = "x" exportCloseButton.Size = UDim2.new(0, 30, 0, 30) exportCloseButton.Position = UDim2.new(1, -30, 0, 0) exportCloseButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0) exportCloseButton.TextColor3 = Color3.fromRGB(255, 255, 255) exportCloseButton.Font = Enum.Font.Code exportCloseButton.TextSize = 15 exportCloseButton.BorderSizePixel = 0 local disclaimerBox = Instance.new("Frame") disclaimerBox.Parent = exportFrame disclaimerBox.Position = UDim2.new(0, 10, 0, 38) disclaimerBox.Size = UDim2.new(1, -20, 0, 48) disclaimerBox.BackgroundColor3 = Color3.fromRGB(26, 26, 22) disclaimerBox.BorderSizePixel = 0 local disclaimerStroke = Instance.new("UIStroke") disclaimerStroke.Parent = disclaimerBox disclaimerStroke.Color = Color3.fromRGB(95, 82, 30) disclaimerStroke.Thickness = 1 local disclaimerLabel = Instance.new("TextLabel") disclaimerLabel.Parent = disclaimerBox disclaimerLabel.Position = UDim2.new(0, 6, 0, 3) disclaimerLabel.Size = UDim2.new(1, -12, 1, -6) disclaimerLabel.BackgroundTransparency = 1 disclaimerLabel.Text = "I dont know if this would fully work on all executor just because they support writefile/loadfile" disclaimerLabel.TextColor3 = Color3.fromRGB(255, 215, 55) disclaimerLabel.Font = Enum.Font.Code disclaimerLabel.TextSize = 10 disclaimerLabel.TextWrapped = true disclaimerLabel.TextXAlignment = Enum.TextXAlignment.Left disclaimerLabel.TextYAlignment = Enum.TextYAlignment.Center local fileInHeader = Instance.new("TextLabel") fileInHeader.Parent = exportFrame fileInHeader.Text = "use file as your input" fileInHeader.AnchorPoint = Vector2.new(0.5, 0) fileInHeader.Position = UDim2.new(0.5, 0, 0, 94) fileInHeader.Size = UDim2.new(0.84, 0, 0, 15) fileInHeader.BackgroundTransparency = 1 fileInHeader.TextColor3 = Color3.fromRGB(205, 205, 205) fileInHeader.Font = Enum.Font.Code fileInHeader.TextSize = 11 fileInHeader.TextXAlignment = Enum.TextXAlignment.Center local fileInToggleBtn = Instance.new("TextButton") fileInToggleBtn.Parent = exportFrame fileInToggleBtn.Text = "OFF" fileInToggleBtn.AnchorPoint = Vector2.new(0.5, 0) fileInToggleBtn.Position = UDim2.new(0.5, 0, 0, 111) fileInToggleBtn.Size = UDim2.new(0.84, 0, 0, 30) fileInToggleBtn.BackgroundColor3 = Color3.fromRGB(15, 15, 15) fileInToggleBtn.TextColor3 = Color3.fromRGB(225, 225, 225) fileInToggleBtn.Font = Enum.Font.Code fileInToggleBtn.TextSize = 12 fileInToggleBtn.BorderSizePixel = 0 local fileInBtnStroke = Instance.new("UIStroke") fileInBtnStroke.Parent = fileInToggleBtn fileInBtnStroke.Color = Color3.fromRGB(60, 60, 60) fileInBtnStroke.Thickness = 1 local inputFileBox = Instance.new("TextBox") inputFileBox.Parent = exportFrame inputFileBox.Position = UDim2.new(0, 88, 0, 111) inputFileBox.Size = UDim2.new(1, -98, 0, 30) inputFileBox.BackgroundColor3 = Color3.fromRGB(20, 20, 20) inputFileBox.TextColor3 = Color3.fromRGB(220, 220, 220) inputFileBox.PlaceholderText = "input file name here" inputFileBox.PlaceholderColor3 = Color3.fromRGB(115, 115, 115) inputFileBox.Font = Enum.Font.Code inputFileBox.TextSize = 11 inputFileBox.ClearTextOnFocus = false inputFileBox.TextXAlignment = Enum.TextXAlignment.Left inputFileBox.Text = "" inputFileBox.BorderSizePixel = 0 inputFileBox.Visible = false local inputFileStroke = Instance.new("UIStroke") inputFileStroke.Parent = inputFileBox inputFileStroke.Color = Color3.fromRGB(52, 52, 52) inputFileStroke.Thickness = 1 local inputFilePad = Instance.new("UIPadding") inputFilePad.Parent = inputFileBox inputFilePad.PaddingLeft = UDim.new(0, 7) inputFilePad.PaddingRight = UDim.new(0, 5) local fileOutHeader = Instance.new("TextLabel") fileOutHeader.Parent = exportFrame fileOutHeader.Text = "export your output to file" fileOutHeader.AnchorPoint = Vector2.new(0.5, 0) fileOutHeader.Position = UDim2.new(0.5, 0, 0, 156) fileOutHeader.Size = UDim2.new(0.84, 0, 0, 15) fileOutHeader.BackgroundTransparency = 1 fileOutHeader.TextColor3 = Color3.fromRGB(205, 205, 205) fileOutHeader.Font = Enum.Font.Code fileOutHeader.TextSize = 11 fileOutHeader.TextXAlignment = Enum.TextXAlignment.Center local fileOutToggleBtn = Instance.new("TextButton") fileOutToggleBtn.Parent = exportFrame fileOutToggleBtn.Text = "OFF" fileOutToggleBtn.AnchorPoint = Vector2.new(0.5, 0) fileOutToggleBtn.Position = UDim2.new(0.5, 0, 0, 173) fileOutToggleBtn.Size = UDim2.new(0.84, 0, 0, 30) fileOutToggleBtn.BackgroundColor3 = Color3.fromRGB(15, 15, 15) fileOutToggleBtn.TextColor3 = Color3.fromRGB(225, 225, 225) fileOutToggleBtn.Font = Enum.Font.Code fileOutToggleBtn.TextSize = 12 fileOutToggleBtn.BorderSizePixel = 0 local fileOutBtnStroke = Instance.new("UIStroke") fileOutBtnStroke.Parent = fileOutToggleBtn fileOutBtnStroke.Color = Color3.fromRGB(60, 60, 60) fileOutBtnStroke.Thickness = 1 local outputFileBox = Instance.new("TextBox") outputFileBox.Parent = exportFrame outputFileBox.Position = UDim2.new(0, 88, 0, 173) outputFileBox.Size = UDim2.new(1, -98, 0, 30) outputFileBox.BackgroundColor3 = Color3.fromRGB(20, 20, 20) outputFileBox.TextColor3 = Color3.fromRGB(220, 220, 220) outputFileBox.PlaceholderText = "input file name here" outputFileBox.PlaceholderColor3 = Color3.fromRGB(115, 115, 115) outputFileBox.Font = Enum.Font.Code outputFileBox.TextSize = 11 outputFileBox.ClearTextOnFocus = false outputFileBox.TextXAlignment = Enum.TextXAlignment.Left outputFileBox.Text = "" outputFileBox.BorderSizePixel = 0 outputFileBox.Visible = false local outputFileStroke = Instance.new("UIStroke") outputFileStroke.Parent = outputFileBox outputFileStroke.Color = Color3.fromRGB(52, 52, 52) outputFileStroke.Thickness = 1 local outputFilePad = Instance.new("UIPadding") outputFilePad.Parent = outputFileBox outputFilePad.PaddingLeft = UDim.new(0, 7) outputFilePad.PaddingRight = UDim.new(0, 5) local useFileInput = false local exportOutputToFile = false local compactLayoutActivated = false local lastOutput = "" local function activateCompactFileControls() if compactLayoutActivated then return end compactLayoutActivated = true local tweenInfo = TweenInfo.new(0.22, Enum.EasingStyle.Quad, Enum.EasingDirection.Out) fileInHeader.AnchorPoint = Vector2.new(0, 0) fileInHeader.TextXAlignment = Enum.TextXAlignment.Left TweenService:Create(fileInHeader, tweenInfo, { Position = UDim2.new(0, 10, 0, 94), Size = UDim2.new(1, -20, 0, 15) }):Play() fileInToggleBtn.AnchorPoint = Vector2.new(0, 0) TweenService:Create(fileInToggleBtn, tweenInfo, { Position = UDim2.new(0, 10, 0, 111), Size = UDim2.new(0, 72, 0, 30) }):Play() fileOutHeader.AnchorPoint = Vector2.new(0, 0) fileOutHeader.TextXAlignment = Enum.TextXAlignment.Left TweenService:Create(fileOutHeader, tweenInfo, { Position = UDim2.new(0, 10, 0, 156), Size = UDim2.new(1, -20, 0, 15) }):Play() fileOutToggleBtn.AnchorPoint = Vector2.new(0, 0) TweenService:Create(fileOutToggleBtn, tweenInfo, { Position = UDim2.new(0, 10, 0, 173), Size = UDim2.new(0, 72, 0, 30) }):Play() inputFileBox.Visible = true outputFileBox.Visible = true end fileInToggleBtn.MouseButton1Click:Connect(function() if not hasFileApis then return end activateCompactFileControls() useFileInput = not useFileInput if useFileInput then fileInToggleBtn.BackgroundColor3 = Color3.fromRGB(32, 155, 62) fileInToggleBtn.Text = "ON" else fileInToggleBtn.BackgroundColor3 = Color3.fromRGB(15, 15, 15) fileInToggleBtn.Text = "OFF" end end) fileOutToggleBtn.MouseButton1Click:Connect(function() if not hasFileApis then return end activateCompactFileControls() exportOutputToFile = not exportOutputToFile if exportOutputToFile then fileOutToggleBtn.BackgroundColor3 = Color3.fromRGB(32, 155, 62) fileOutToggleBtn.Text = "ON" else fileOutToggleBtn.BackgroundColor3 = Color3.fromRGB(15, 15, 15) fileOutToggleBtn.Text = "OFF" end end) exportToggleButton.MouseButton1Click:Connect(function() if not hasFileApis then return end exportFrame.Visible = not exportFrame.Visible end) exportCloseButton.MouseButton1Click:Connect(function() exportFrame.Visible = false end) xButton.MouseButton1Click:Connect(function() ScreenGui:Destroy() end) clearButton.MouseButton1Click:Connect(function() inputBox.Text = "" statusLabel.Text = "Input Cleared" statusLabel.TextColor3 = Color3.fromRGB(160, 160, 160) end) copyButton.MouseButton1Click:Connect(function() local toCopy = lastOutput if toCopy == "" then toCopy = outputBox.Text end if toCopy == "" then statusLabel.Text = "Nothing to copy" statusLabel.TextColor3 = Color3.fromRGB(220, 140, 80) return end if setclipboard then setclipboard(toCopy) copyButton.Text = "Copied!" statusLabel.Text = string.format("Copied %d bytes", #toCopy) statusLabel.TextColor3 = Color3.fromRGB(90, 210, 120) task.delay(1.5, function() if copyButton and copyButton.Parent then copyButton.Text = "Copy" end end) else statusLabel.Text = "setclipboard unavailable" statusLabel.TextColor3 = Color3.fromRGB(220, 95, 95) end end) local dragging, dragInput, dragStart, startPos mainframe.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch 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) mainframe.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then dragInput = input end end) UIS.InputChanged:Connect(function(input) if input == dragInput and dragging then local delta = input.Position - dragStart mainframe.Position = UDim2.new( startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y ) end end) local b96chars = "\t !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" local depNames = {"game", "workspace", "Instance", "task", "Enum", "Color3", "UDim2", "Vector3", "CFrame", "math", "string", "table"} local ssub, schar, sbyte, sfind, sformat, smatch, sgmatch, sgsub, srep = string.sub, string.char, string.byte, string.find, string.format, string.match, string.gmatch, string.gsub, string.rep local mfloor, mrandom, mmax = math.floor, math.random, math.max local tconcat, tinsert = table.concat, table.insert local function wrapLongBracket(str) local maxEq = 0 for eqs in sgmatch(str, "%](=*)") do if #eqs >= maxEq then maxEq = #eqs + 1 end end for eqs in sgmatch(str, "%[(=*)%[") do if #eqs >= maxEq then maxEq = #eqs + 1 end end if maxEq < 1 then maxEq = 1 end local eq = srep("=", maxEq) return "[" .. eq .. "[" .. str .. "]" .. eq .. "]" end local function shuffledIndices(count) local list = {} for i = 1, count do list[i] = i end for i = count, 2, -1 do local j = mrandom(1, i) list[i], list[j] = list[j], list[i] end return list end local function randomIdent(prefix) return sformat("_%s%x", prefix, mrandom(0x10, 0xff)) end local function shuffleAlphabet(seed) local chars = {} for i = 1, #b96chars do chars[i] = ssub(b96chars, i, i) end local state = seed for i = #chars, 2, -1 do state = (state * 1103515245 + 12345) % 2147483648 local j = (state % i) + 1 chars[i], chars[j] = chars[j], chars[i] end return tconcat(chars) end local function compressLZW_Base96(str, alphabet) local alphaChars = {} for i = 1, 96 do alphaChars[i] = ssub(alphabet, i, i) end local function createInitDict() local dict = {} for i = 0, 255 do dict[schar(i)] = i end return dict, 257 end local dict, dictSize = createInitDict() local bitWidth = 9 local bitBuf = 0 local bitCount = 0 local res = {} local resLen = 0 local function pushBits(val, width) bitBuf = bitBuf + val * (2 ^ bitCount) bitCount = bitCount + width while bitCount >= 13 do local chunk = bitBuf % 8192 bitBuf = mfloor(bitBuf / 8192) bitCount = bitCount - 13 local c1 = mfloor(chunk / 96) + 1 local c2 = (chunk % 96) + 1 resLen = resLen + 1 res[resLen] = alphaChars[c1] .. alphaChars[c2] end end local w = "" for i = 1, #str do local c = ssub(str, i, i) local wc = w .. c if dict[wc] then w = wc else pushBits(dict[w], bitWidth) dict[wc] = dictSize dictSize = dictSize + 1 if dictSize >= 8192 then dict, dictSize = createInitDict() bitWidth = 9 elseif dictSize > (2 ^ bitWidth) then bitWidth = bitWidth + 1 end w = c end end if w ~= "" then pushBits(dict[w], bitWidth) dictSize = dictSize + 1 if dictSize >= 8192 then bitWidth = 9 elseif dictSize > (2 ^ bitWidth) then bitWidth = bitWidth + 1 end end pushBits(256, bitWidth) if bitCount > 0 then local chunk = bitBuf % 8192 local c1 = mfloor(chunk / 96) + 1 local c2 = (chunk % 96) + 1 resLen = resLen + 1 res[resLen] = alphaChars[c1] .. alphaChars[c2] end return tconcat(res) end local function computeState(encoded, alphabet, initState) local seen = {} local st = initState or 0 for i = 1, #encoded do local ch = ssub(encoded, i, i) if not seen[ch] then local pos = sfind(alphabet, ch, 1, true) if pos then st = (st + pos) % 65521 seen[ch] = true end end end return st end local function buildEncodedCompilerBytes(seed) local shift = (seed % 31) + 7 local target = "loadstring" local bytes = {} for i = 1, #target do bytes[i] = tostring(sbyte(target, i) + shift) end return "{" .. tconcat(bytes, ",") .. "}" end local function minifyAndLiftConstants(src) local out = {} local outLen = 0 local constants = {} local constMap = {} local lastSigChar = "" local i = 1 local n = #src local function emit(s) outLen = outLen + 1 out[outLen] = s end local function isWordChar(c) return c ~= "" and smatch(c, "[A-Za-z0-9_]") ~= nil end local function registerConst(typeTag, rawLiteral) local key = typeTag .. ":" .. rawLiteral local id = constMap[key] if not id then id = #constants + 1 constants[id] = rawLiteral constMap[key] = id end return "\1K" .. tostring(id) .. "\2" end while i <= n do local ch = ssub(src, i, i) local two = ssub(src, i, i + 1) if two == "--" then local eqs = smatch(src, "^%-%-%[(=*)%[", i) if eqs then local closePat = "]" .. eqs .. "]" local _, endPos = sfind(src, closePat, i + 4 + #eqs, true) if endPos then i = endPos + 1 else break end else local nl = sfind(src, "\n", i, true) if nl then if lastSigChar ~= "" and lastSigChar ~= "\n" and lastSigChar ~= ";" then emit("\n") lastSigChar = "\n" end i = nl + 1 else break end end elseif ch == "\r" then i = i + 1 elseif ch == "\n" or ch == ";" then if lastSigChar ~= "" and lastSigChar ~= "\n" and lastSigChar ~= ";" then emit(ch) lastSigChar = ch end i = i + 1 elseif ch == " " or ch == "\t" then local j = i + 1 while j <= n do local ws = ssub(src, j, j) if ws == " " or ws == "\t" then j = j + 1 else break end end local nextCh = ssub(src, j, j) if isWordChar(lastSigChar) and isWordChar(nextCh) then emit(" ") lastSigChar = " " elseif lastSigChar == "." and smatch(nextCh, "[0-9%.]") then emit(" ") lastSigChar = " " elseif lastSigChar == "-" and nextCh == "-" then emit(" ") lastSigChar = " " end i = j elseif ch == "[" then local eqs = smatch(src, "^%[(=*)%[", i) if eqs then local closePat = "]" .. eqs .. "]" local _, endPos = sfind(src, closePat, i + 2 + #eqs, true) if endPos then emit(ssub(src, i, endPos)) lastSigChar = "]" i = endPos + 1 else emit(ch) lastSigChar = ch i = i + 1 end else emit(ch) lastSigChar = ch i = i + 1 end elseif ch == '"' or ch == "'" then local j = i + 1 while j <= n do local c = ssub(src, j, j) if c == "\\" then j = j + 2 elseif c == ch then break else j = j + 1 end end local rawLit = ssub(src, i, j) if isWordChar(lastSigChar) then emit(" ") end emit(registerConst("S", rawLit)) lastSigChar = ")" i = j + 1 elseif ch == "`" then local j = i + 1 while j <= n do local c = ssub(src, j, j) if c == "\\" then j = j + 2 elseif c == "`" then break else j = j + 1 end end emit(ssub(src, i, j)) lastSigChar = "`" i = j + 1 elseif ssub(src, i, i + 2) == "..." then emit("...") lastSigChar = "." i = i + 3 elseif two == ".." then emit("..") lastSigChar = "." i = i + 2 elseif smatch(ch, "[0-9]") or (ch == "." and smatch(src, "^%.[0-9]", i)) then local numLit = smatch(src, "^0[xX][0-9a-fA-F_]+", i) or smatch(src, "^0[bB][01_]+", i) or smatch(src, "^[0-9][0-9_]*%.[0-9_]+[eE][+-]?[0-9_]+", i) or smatch(src, "^[0-9][0-9_]*[eE][+-]?[0-9_]+", i) or smatch(src, "^[0-9][0-9_]*%.[0-9_]+", i) or smatch(src, "^%.[0-9_]+[eE][+-]?[0-9_]+", i) or smatch(src, "^%.[0-9_]+", i) or smatch(src, "^[0-9][0-9_]*", i) if numLit then if isWordChar(lastSigChar) then emit(" ") end emit(registerConst("N", numLit)) lastSigChar = ")" i = i + #numLit else emit(ch) lastSigChar = ch i = i + 1 end elseif smatch(ch, "[A-Za-z_]") then local word = smatch(src, "^[A-Za-z_][A-Za-z0-9_]*", i) if (word == "true" or word == "false") and lastSigChar ~= "." and lastSigChar ~= ":" then if isWordChar(lastSigChar) then emit(" ") end emit(registerConst("B", word)) lastSigChar = ")" else emit(word) lastSigChar = ssub(word, -1, -1) end i = i + #word else emit(ch) lastSigChar = ch i = i + 1 end end return tconcat(out), constants end local function splitTopLevelCode(src) local segments = {} local current = {} local blockDepth = 0 local parenDepth = 0 local inLoopHeader = false local hasTopLocalVar = false local i = 1 local n = #src while i <= n do local ch = ssub(src, i, i) if ch == "[" then local eqs = smatch(src, "^%[(=*)%[", i) if eqs then local closePat = "]" .. eqs .. "]" local _, endPos = sfind(src, closePat, i + 2 + #eqs, true) if endPos then tinsert(current, ssub(src, i, endPos)) i = endPos + 1 else tinsert(current, ch) i = i + 1 end else parenDepth = parenDepth + 1 tinsert(current, ch) i = i + 1 end elseif ch == '"' or ch == "'" or ch == "`" then local j = i + 1 while j <= n do local c = ssub(src, j, j) if c == "\\" then j = j + 2 elseif c == ch then break else j = j + 1 end end tinsert(current, ssub(src, i, j)) i = j + 1 elseif ch == "(" or ch == "{" then parenDepth = parenDepth + 1 tinsert(current, ch) i = i + 1 elseif ch == ")" or ch == "}" or ch == "]" then parenDepth = mmax(0, parenDepth - 1) tinsert(current, ch) i = i + 1 elseif smatch(ch, "[A-Za-z_]") then local word = smatch(src, "^[A-Za-z_][A-Za-z0-9_]*", i) local nextIdx = i + #word if parenDepth == 0 then if word == "local" and blockDepth == 0 then hasTopLocalVar = true elseif word == "for" or word == "while" then blockDepth = blockDepth + 1 inLoopHeader = true elseif word == "do" then if inLoopHeader then inLoopHeader = false else blockDepth = blockDepth + 1 end elseif word == "if" or word == "function" or word == "repeat" then blockDepth = blockDepth + 1 elseif word == "end" or word == "until" then blockDepth = mmax(0, blockDepth - 1) end end if word ~= "" then tinsert(current, word) end i = nextIdx elseif (ch == "\n" or ch == ";") and blockDepth == 0 and parenDepth == 0 then tinsert(current, ch) local chunkStr = tconcat(current) if not hasTopLocalVar and #sgsub(chunkStr, "%s+", "") > 24 then tinsert(segments, chunkStr) current = {} end i = i + 1 else tinsert(current, ch) i = i + 1 end end local tail = tconcat(current) if #sgsub(tail, "%s+", "") > 0 then if hasTopLocalVar and #segments > 0 then segments[#segments] = segments[#segments] .. "\n" .. tail else tinsert(segments, tail) end end if #segments == 0 then segments[1] = src end return segments end local function compilePayloadFromSource(input) local seed = mrandom(100000, 999999) + (mfloor((os.clock() % 1) * 100000) % 99999) local compilerBytes = buildEncodedCompilerBytes(seed) local busVar = randomIdent("b") local gateVar = randomIdent("g") local gateOrder = shuffledIndices(12) local busOrder = shuffledIndices(12) local assignOrder = shuffledIndices(12) local declOrder = shuffledIndices(12) local constSalt = (seed % 7919) + 9500 local runtimeDepList = {} local depToBusSlot = {} for g = 1, 12 do local depIdx = gateOrder[g] runtimeDepList[g] = "e." .. depNames[depIdx] depToBusSlot[depIdx] = busOrder[g] end local runtimeDepsLiteral = "{" .. tconcat(runtimeDepList, ",") .. "}" local initStmts = {} for idx = 1, 12 do local g = assignOrder[idx] initStmts[idx] = sformat("%s[%d]=%s(%d)", busVar, busOrder[g], gateVar, g) end local declNames = {} local declCalls = {} for idx = 1, 12 do local depIdx = declOrder[idx] declNames[idx] = depNames[depIdx] declCalls[idx] = sformat("%s(%d)", busVar, constSalt - depToBusSlot[depIdx]) end local depDecl = sformat("local %s=%s;", tconcat(declNames, ","), tconcat(declCalls, ",")) local cleanCode, liftedConstants = minifyAndLiftConstants(input) local numConsts = #liftedConstants local constChunk if numConsts > 0 then local slotPool = {} local curSlot = mrandom(35, 180) for idx = 1, numConsts do curSlot = curSlot + mrandom(1, 9) slotPool[idx] = curSlot end local slotPerm = shuffledIndices(numConsts) local origToSlot = {} for idx = 1, numConsts do origToSlot[idx] = slotPool[slotPerm[idx]] end cleanCode = sgsub(cleanCode, "\1K(%d+)\2", function(idStr) local origId = tonumber(idStr) local encodedIdx = constSalt - origToSlot[origId] return sformat("%s(%d)", busVar, encodedIdx) end) local writePerm = shuffledIndices(numConsts) local constStmts = {} for idx = 1, numConsts do local origId = writePerm[idx] constStmts[idx] = sformat("%s[%d]=%s", busVar, origToSlot[origId], liftedConstants[origId]) end constChunk = sformat("local %s=%s;%s", busVar, busVar, tconcat(constStmts, ";")) else constChunk = sformat("local %s=%s", busVar, busVar) end local codeSegments = splitTopLevelCode(cleanCode) local rawChunks = {} rawChunks[1] = sformat("local %s,%s=%s,%s;%s", busVar, gateVar, busVar, gateVar, tconcat(initStmts, ";")) rawChunks[2] = constChunk local headerPrefix = sformat("local %s=%s;%s", busVar, busVar, depDecl) for idx = 1, #codeSegments do rawChunks[2 + idx] = headerPrefix .. "\n" .. codeSegments[idx] end local serializedSegs = {} local runningState = seed % 65521 for idx = 1, #rawChunks do local segSeed = seed + (idx * 7919) local segAlpha = shuffleAlphabet(segSeed) local segEncoded = compressLZW_Base96(rawChunks[idx], segAlpha) runningState = computeState(segEncoded, segAlpha, runningState) serializedSegs[idx] = sformat("{%s,%d,%s}", wrapLongBracket(segEncoded), runningState, wrapLongBracket(segAlpha)) end local segTableLiteral = "{" .. tconcat(serializedSegs, ",") .. "}" local runtimeTemplate = 'return(function(S,k,f)local e=getfenv(1)local C,F,U,M,Z,E,P,R,O,Y,X=e.string.char,e.string.find,e.string.sub,e.math.floor,e.setmetatable,e.setfenv,e.pcall,e.rawset,e.tostring,e.type,e.error local function T(t,m)m.__metatable=false return Z(t,m)end local cp=T(f,{__index=function(t,x)if x==0 then local n,h,g="",(k%%31)+7,e.getgenv for i=1,#t do n=n..C(t[i]-h)t[i]=nil end local c=e[n]or(Y(g)=="function"and g()[n])if c then R(t,0,c)return c end end end})local D,s,c,r,v,p,L,K,a,b,u,q=%s,k%%65521,0,{},{},{},nil,nil,1,1,nil,(k%%7919)+9500 local G=T({},{__call=function(_,x)local i=x+s-c local w=D[i]D[i]=nil return w end,__newindex=function()end})local B=T({},{__newindex=function(_,x,w)if not L then local i=x+s-c r[i]=w v[i]=1 end end,__call=function(_,x)local i=q-x+s-c if not v[i]then s=(s+17)%%65521 return end local w=r[i]if u and i<=12 then r[i],v[i]=nil,nil end return w end})local pE=T({},{__index=function(_,x)if a then a=nil return B elseif b then b=nil return G end local w=p[x]if w~=nil then return w end return e[x]end,__newindex=function(_,x,w)if not K then p[x]=w end end})local dc=T({},{__call=function(_,g)local z,y,A=g[1],g[2],g[3]c=y local m=T({},{__index=function(t,h)local j=F(A,h,1,true)if j then s=(s+j)%%65521 R(t,h,j-1)return j-1 end return 0 end})local function I()local d={}for i=0,255 do d[i]=C(i)end return d,257,9 end local d,n,w=I()local j,B,N=1,0,0 local function H(l)while N#z then return end B=B+(m[U(z,j,j)]*96+m[U(z,j+1,j+1)])*(2^N)j,N=j+2,N+13 end local k=2^l local x=B%%k B,N=M(B/k),N-l return x end local Q=T({},{__add=function(t,h)local l=#t+1 t[l]=h while l>1 and #t[l]>=#t[l-1]do t[l-1],t[l],l=t[l-1]..t[l],nil,l-1 end return t end,__tostring=function(t)while #t>1 do local l=#t t[l-1],t[l]=t[l-1]..t[l],nil end return t[1]or""end})local f1=H(w)if not f1 or f1==256 then return""end local W,J=d[f1]Q=Q+W while true do local y=H(w)if not y or y==256 then break end if J then W,J=d[y],nil Q=Q+W else local E=d[y]or(W..U(W,1,1))Q,d[n],n,W=Q+E,W..U(E,1,1),n+1,E if n>=8191 then d,n,w,J=I()J=1 elseif n>=(2^w)then w=w+1 end end end return O(Q)end})for i=1,#S do local g=S[i]S[i]=nil local z,l=dc(g),cp[0]if not l then X("Compiler loadstring not found in environment!")end local w,m=l(z)z=nil if Y(w)~="function"then X("Compile Error: "..O(m))end E(w,pE)a,u=1,i==#S local o,d=P(w)a,b,G,D=nil,nil,nil,nil if i==2 then L=1 end if not o then X("Runtime Error: "..O(d))end end K=1 end)(%s,%d,%s)' return sformat( runtimeTemplate, runtimeDepsLiteral, segTableLiteral, seed, compilerBytes ) end local function displayToOutputBox(payload) lastOutput = payload local byteLen = #payload sizeLabel.Text = string.format("%d bytes", byteLen) if byteLen > 199999 then outputBox.Text = string.format( "WARNING: output exceeding maximum roblox capabilites to show text on textbox, to copy your output, click 'copy' button, your output size is : %d byte", byteLen ) else outputBox.Text = payload end end local function readSourceFromFile(fileName) if fileName == "" then return nil, fileName end if type(isfile) == "function" then local existsOk, exists = pcall(isfile, fileName) if not existsOk or not exists then return nil, fileName end end local loadOk, loadedFn = pcall(loadfile, fileName) if not loadOk or type(loadedFn) ~= "function" then return nil, fileName end if type(readfile) == "function" then local readOk, content = pcall(readfile, fileName) if readOk and type(content) == "string" then return content, nil end end return nil, fileName end encodeButton.MouseButton1Click:Connect(function() local sourceText = "" if hasFileApis and useFileInput then local targetInFile = string.match(inputFileBox.Text, "^%s*(.-)%s*$") local loadedSource, missingName = readSourceFromFile(targetInFile) if not loadedSource then lastOutput = "" sizeLabel.Text = "0 bytes" outputBox.Text = string.format("Theres no file with name '%s'", missingName or targetInFile) statusLabel.Text = "File not found" statusLabel.TextColor3 = Color3.fromRGB(220, 95, 95) return end sourceText = loadedSource else sourceText = inputBox.Text end if sourceText == "" or #sourceText < 2 then encodeButton.Text = "Script too short!" statusLabel.Text = "Invalid input" statusLabel.TextColor3 = Color3.fromRGB(220, 140, 80) task.delay(1.2, function() if encodeButton and encodeButton.Parent then encodeButton.Text = "Encode" end end) return end encodeButton.Text = "Compressing..." statusLabel.Text = "Processing..." statusLabel.TextColor3 = Color3.fromRGB(230, 195, 75) task.wait() local ok, resultOrErr = pcall(compilePayloadFromSource, sourceText) if not ok then statusLabel.Text = "Compression error" statusLabel.TextColor3 = Color3.fromRGB(220, 95, 95) outputBox.Text = tostring(resultOrErr) encodeButton.Text = "Encode" return end local finalPayload = resultOrErr lastOutput = finalPayload sizeLabel.Text = string.format("%d bytes", #finalPayload) if hasFileApis and exportOutputToFile then local targetOutFile = string.match(outputFileBox.Text, "^%s*(.-)%s*$") if targetOutFile == "" then targetOutFile = "compressed_output.lua" end local writeOk, writeErr = pcall(writefile, targetOutFile, finalPayload) if writeOk then if useFileInput then statusLabel.Text = "E2E Exported -> " .. targetOutFile else statusLabel.Text = "Exported -> " .. targetOutFile end statusLabel.TextColor3 = Color3.fromRGB(90, 210, 120) else statusLabel.Text = "Writefile failed" statusLabel.TextColor3 = Color3.fromRGB(220, 95, 95) outputBox.Text = tostring(writeErr) end else displayToOutputBox(finalPayload) statusLabel.Text = "Compressed successfully" statusLabel.TextColor3 = Color3.fromRGB(90, 210, 120) end encodeButton.Text = "Encode" end)