print("--//Made with Zfuscator\\--")
-- Define the Maximum Obfuscator Function
function obfuscate(script)
-- Helper Functions
local function generateRandomName()
return "var" .. math.random(1000000, 9999999)
end
local function encryptString(str)
local result = ""
for i = 1, #str do
local c = str:sub(i, i)
local enc = string.format("\\x%02X", string.byte(c))
result = result .. enc
end
return result
end
local function decryptString(str)
return (str:gsub("\\x(%x%x)", function(hex)
return string.char(tonumber(hex, 16))
end))
end
-- Variable and Function Renaming
local renamed = {}
local counter = 0
script = script:gsub("%f[%a_](%w+)%f[^%w_]", function(var)
if not renamed[var] then
counter = counter + 1
renamed[var] = generateRandomName()
end
return renamed[var]
end)
-- String Encryption
script = script:gsub('"(.-)"', function(str)
return '"..decryptString("' .. encryptString(str) .. '").."'
end)
-- Add Decryption Function to the Script
script = [[
local function decryptString(str)
return (str:gsub("\\x(%x%x)", function(hex)
return string.char(tonumber(hex, 16))
end))
end
]] .. script
-- Complex Control Flow Obfuscation
script = [[
local function wrapper()
local function _a() return true end
local function _b() if _a() then
while not false do
if true then
local function _c() return not false end
if _c() then
-- Begin Obfuscated Code Block
local _d = 0
repeat
local _e = function() return _d < 10 end
if _e() then
local _f = function()
local _g = function()
return not not true
end
if _g() then
local _h = function()
return true
end
if _h() then
-- Obfuscated Code Insertion
local _i = 1
while _i <= 10 do
if _i % 2 == 0 then
-- Real code starts here
print("Hello from Roblox")
-- Real code ends here
end
_i = _i + 1
end
end
end
end
end
_d = _d + 1
until _d >= 10
-- End Obfuscated Code Block
end
end
end
end end
_b()
end
wrapper()
]]
-- Additional Obfuscation
script = "local dummy = function() return true end; local junk = function() " ..
"for i=1,500 do if i % 3 == 0 then local a = i * 2 end end end; junk(); dummy(); " .. script
-- Whitespace Removal & Code Flattening
script = script:gsub("%s+", "") -- Remove whitespace and newlines
script = script:gsub("\n", "") -- Remove newlines
script = script:gsub("endend", "end") -- Flatten end statements
return script
end
-- Your Roblox 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)
To embed this project on your website, copy the following code and paste it into your website's HTML: