local script_to_obfuscate = [[
  print('hey ***** uwuu')
]]

function wait(seconds)
    local start = os.time()
    repeat until os.time() > start + seconds
end
dofile("e.lua")
print("Thank you for using DayLock Lua Obfuscator  //  version 1.0\n")
print("This obfuscator uses loadstring, please enable loadstring in ServerScriptServcice if you intend on using this for a game in ROBLOX Studio.\n")
wait(0.5)
print("Before you enter your script, please select the settings\n")
wait(0.1)
print("Do you want your obfuscated script to have a smaller output?(Y/N)\n")
local yorn = io.read()
local amOfVarsFunctionsAndNum = 0
if string.match(yorn,"y") then
  amOfVarsFunctionsAndNums = 30
elseif string.match(yorn,"Y") then
  amOfVarsFunctionsAndNums = 30
elseif string.match(yorn,"n") then
  amOfVarsFunctionsAndNums = 456
elseif string.match(yorn,"N") then
  amOfVarsFunctionsAndNums = 4964
else
  print("\nInvalid settings / Restart obfuscator")
  os.exit()
end
print("\nSettings finished / Obfuscating\n\n")

wait(0.05)

for i=0, 2 do
wait(0.3)
print("\nObfuscating...\n")
end

local string_list = {
  "James is not gay",
  "nah we good",
  "Victorious warriors win first and then go to war, while defeated warriors go to war first and then seek to win.",
  "In the midst of chaos, there is also opportunity.",
  "`huh idk *****` - LxstKowalik",
  "What am i doing with my life? making lego hacks",
  "`no ***** its ***** 2 PM for you` - LxstDev",
  "while monkey do true when end for *****,monkey in pairs do end return ***** end",
  "i luv bobox",
  "why did i choose to learn lua",
  "this is crackable",
  "when working deobfuscator",
  "i didnt use ironbrew sc  |  bad idea",
  "BO version 1.0 = trash obfuscator  |  use moonsec",
  "imposter??",
  "kowalik is gay",
  "You know lua? Name every single metamethod!",
  "define getfenv",
  "G-G-GUYS IS JJSPLOIT A-A-A V-VIRUS??!1!:?1?",
  "what does print do",
  "congrats you did a thing and made your code hard to ` read",
  "e",
  "thats what the point of the mask is",
  "#6$2*640x2  omgz look incripted numbors!1!",
  "while amogus true do return sus end",
  "sussy baka lol",
  "synapse xen only good obfuscator",
  "i wonder if i should include i's and l's",
  "luraph sucks",
  "⨈ĂcτπγΖζ௹૱"
}


function getRandomStringFromTable(table)
  local amountofthingsintable = #table
  local randnum = math.random(1,amountofthingsintable)
  local count = 0
  for i, v in pairs(table)do
    count = count + 1
    if count == randnum then
      return v
    end
  end
end


local obfuscated_script = "local v0c04ch5=\"OBFUSCATED WITH DAYLOCK LUA OBFUSCATOR\""

local encoded = script_to_obfuscate:gsub(".", function(bb) return "\\" .. bb:byte() end) or script_to_obfuscate .. "\""

function addVarToString()
  obfuscated_script = obfuscated_script.." local DayLock_"..math.random(10000000,99999999).." = "..math.random(1,5254).." "
end

function addStringVarToString()
  obfuscated_script = obfuscated_script.." local DayLock_"..math.random(10000000,99999999).."=\""..getRandomStringFromTable(string_list).."\""
end

function addFuncToString()
  obfuscated_script = obfuscated_script.." function DayLock_"..math.random(100000000,999999999).."()return \""..getRandomStringFromTable(string_list).."\" end"
end

for i=0, amOfVarsFunctionsAndNums do
  addVarToString()
  addStringVarToString()
  addFuncToString()
end


obfuscated_script = obfuscated_script.." loadstring(\""..encoded.."\")()"


for i=0, amOfVarsFunctionsAndNums do
  addVarToString()
  addStringVarToString()
  addFuncToString()
end
print(obfuscated_script) 

Lua online compiler

Write, Run & Share Lua code online using OneCompiler's Lua online compiler for free. It's one of the robust, feature-rich online compilers for Lua language, running the latest Lua version 5.4. Getting started with the OneCompiler's Lua editor is easy and fast. The editor shows sample boilerplate code when you choose language as Lua and start coding.

Taking inputs (stdin)

OneCompiler's Lua online editor supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample Lua program which takes name as input and prints hello message with your name.

name = io.read("*a")
print ("Hello ", name)

About Lua

Lua is a light weight embeddable scripting language which is built on top of C. It is used in almost all kind of applications like games, web applications, mobile applications, image processing etc. It's a very powerful, fast, easy to learn, open-source scripting language.

Syntax help

Variables

  • By default all the variables declared are global variables
  • If the variables are explicitly mentioned as local then they are local variables.
  • Lua is a dynamically typed language and hence only the values will have types not the variables.

Examples

-- global variables
a = 10

-- local variables

local x = 30
Value TypeDescription
numberRepresents numbers
stringRepresents text
nilDifferentiates values whether it has data or not
booleanValue can be either true or false
functionRepresents a sub-routine
userdataRepresents arbitary C data
threadRepresents independent threads of execution.
tableCan hold any value except nil

Loops

1. While:

While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.

while(condition)
do
--code
end

2. Repeat-Until:

Repeat-Until is also used to iterate a set of statements based on a condition. It is very similar to Do-While, it is mostly used when you need to execute the statements atleast once.

repeat
   --code
until( condition )

3. For:

For loop is used to iterate a set of statements based on a condition.

for init,max/min value, increment
do
   --code
end

Functions

Function is a sub-routine which contains set of statements. Usually functions are written when multiple calls are required to same set of statements which increase re-usuability and modularity.

optional_function_scope function function_name( argument1, argument2, argument3........, argumentn)
--code
return params with comma seperated
end