print("--//Made with Zfuscator\\--")
-- Define the Obfuscator Function
function obfuscate(script)
-- Helper Functions
local function generateRandomName()
return "v" .. math.random(10000, 99999)
end
local function encryptString(str)
return (str:gsub(".", function(c)
return string.format("\\x%02X", string.byte(c))
end))
end
local function decryptString(str)
return (str:gsub("\\x(%x%x)", function(hex)
return string.char(tonumber(hex, 16))
end))
end
-- Variable 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
-- Control Flow Obfuscation
script = "if false then while true do if true then " .. script .. " end end end else " .. script .. " end"
-- 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
-- Dead Code Insertion
script = "local dummy = function() return true end; dummy(); " .. script
return script
end
-- Define the Script You Want to Obfuscate
local targetScript = [[
local myVar = "Script here! "
print(myVar)
]]
-- Obfuscate the Target Script
local obfuscatedScript = obfuscate(targetScript)
-- Output the Obfuscated Script as a Roblox Script
print("-- Obfuscated Script Start --")
print(obfuscatedScript)
print("-- Obfuscated Script End --")
To embed this project on your website, copy the following code and paste it into your website's HTML: