print("--//Made with Zfuscator!\\--")

-- Define the Ultimate Obfuscator Function
function obfuscate(script)
    -- Helper Functions
    local function generateRandomName()
        return "var" .. math.random(1000000000, 9999999999)
    end

    local function generateRandomString(length)
        local chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
        local str = ''
        for i = 1, length do
            local rand = math.random(1, #chars)
            str = str .. chars:sub(rand, rand)
        end
        return str
    end

    local function encryptString(str, key)
        local encrypted = {}
        for i = 1, #str do
            local c = str:sub(i, i)
            local enc = string.format("\\x%02X", string.byte(c) ~ key)
            table.insert(encrypted, enc)
        end
        return table.concat(encrypted)
    end

    local function decryptString(str, key)
        return (str:gsub("\\x(%x%x)", function(hex)
            return string.char(tonumber(hex, 16) ~ key)
        end))
    end

    local function encryptMultipleLayers(str)
        local key1 = math.random(1, 255)
        local key2 = math.random(1, 255)
        local key3 = math.random(1, 255)
        local encrypted1 = encryptString(str, key1)
        local encrypted2 = encryptString(encrypted1, key2)
        local encrypted3 = encryptString(encrypted2, key3)
        return encrypted3, key1, key2, key3
    end

    -- Generate Complex Dynamic Code
    local function generateComplexCode()
        local code = {}
        table.insert(code, "local function complexFunction()")
        table.insert(code, "local a = math.random(1, 100)")
        table.insert(code, "local b = math.random(1, 100)")
        table.insert(code, "local result = a * b")
        table.insert(code, "if result % 2 == 0 then")
        table.insert(code, "    print('Even result:', result)")
        table.insert(code, "else")
        table.insert(code, "    print('Odd result:', result)")
        table.insert(code, "end")
        table.insert(code, "end")
        table.insert(code, "complexFunction()")
        return table.concat(code, "\n")
    end

    -- Generate Self-Decryption and Execution Code
    local function generateSelfDecryptAndExecute()
        local encryptedCode, key1, key2, key3 = encryptMultipleLayers(generateComplexCode())
        return [[
            local function decryptString(str, key)
                return (str:gsub("\\x(%x%x)", function(hex)
                    return string.char(tonumber(hex, 16) ~ key)
                end))
            end

            local function selfDecrypt()
                local encryptedCode = "]] .. encryptedCode .. [["
                local decryptedCode = decryptString(decryptString(decryptString(encryptedCode, ]] .. key3 .. [[), ]] .. key2 .. [[), ]] .. key1 .. [[)
                loadstring(decryptedCode)()
            end

            selfDecrypt()
        ]]
    end

    -- Advanced Anti-Tampering and Anti-Debugging
    local function antiTamperAndDebug()
        return [[
            local function antiTamper()
                if debug.getinfo(2, "S") then
                    error("Tampering detected! Script integrity compromised.")
                end
            end

            local function antiDebug()
                if pcall(function() return debug.getinfo(1) end) then
                    while true do end
                end
            end

            antiTamper()
            antiDebug()
        ]]
    end

    -- Randomized Execution with Multiple Steps
    local function randomizedExecution()
        local steps = {}
        for i = 1, 50 do
            local stepCode = "print('Executing randomized step " .. i .. "')"
            table.insert(steps, stepCode)
        end
        return "local function executeRandomly() " .. table.concat(steps, " ") .. " end executeRandomly()"
    end

    -- Combine All Parts with Enhanced Complexity
    local obfuscatedScript = antiTamperAndDebug() .. generateSelfDecryptAndExecute() .. randomizedExecution()

    -- Additional Obfuscation Layers (100 times)
    for i = 1, 100 do
        obfuscatedScript = [[
            local function layer]] .. i .. [[()
                -- Additional obfuscation layer ]] .. i .. [[
                local function innerLayer]] .. i .. [[()
                    ]] .. obfuscatedScript .. [[
                end
                innerLayer]] .. i .. [[()
            end
            layer]] .. i .. [[()
        ]]
    end

    -- Whitespace Removal & Code Flattening
    obfuscatedScript = obfuscatedScript:gsub("%s+", "") -- Remove whitespace and newlines
    obfuscatedScript = obfuscatedScript:gsub("\n", "") -- Remove newlines
    obfuscatedScript = obfuscatedScript:gsub("endend", "end") -- Flatten end statements

    return obfuscatedScript
end

-- Your Lua script to be obfuscated
local myScript = [[
    Script here! 
]]

-- Obfuscate the Script
local obfuscatedScript = obfuscate(myScript)

-- Print the Obfuscated Script (for debugging or review)
print(obfuscatedScript)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: