I was working on a Lua obfuscator as a little project for myself, but I ran into an issue very quickly.
Let’s say I have the code:
and I wanted to encrypt the string to bytecode. How would I go through a line, check if there is a string, if there is, encrypt it? I have an idea for a single string on a line, but I’m not sure how I would work multiple strings or strings with double quotes/single quotes in them.
Here’s a script to check if a variable is a string:
local function checker(var) --create function that receives a variable
if typeof(var) == "string" then --checks if variable is a string
return var .. "is a string!" --return result
return var.Name .. "is not a string!"
local var1 = "words"
local var2 = workspace.Part
possibleString1 = checker(var1) --call function and send variable 'var1'
possibleString2 = checker(var2) --call function and send variable 'var2'
print(possibleString1) --print results
words is a string!
Part is not a string!
I don’t know how to convert to bytes, though. Maybe you can find it elsewhere on the forum, or someone else decides to be a helpful person!