Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you compile a lua script so is just numbers?

Asked by 5 years ago

i wanna make a scripts script not able to be seen but how do i compile a lua code? for example like this: \86\97\108\117\101

0
That is just escaping the byte values of "V", "a", "l", "u", and "e". You'd probably have to write your own compiler to write in pure "escaped byte values", if that is your inquiry. You theoretically can use loadstring as well. [loadstring("\112\114\105\110\116" .. "(\"Hello world\")")();] User#24403 69 — 5y
0
But if your goal is to obfuscate your code: don't do it. You lose performance, readability and maintainability. User#24403 69 — 5y

1 answer

Log in to vote
0
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago
local str = [[code here]]
local out = ""
for i=1,#str do
    out = out .. "\\" .. str:byte(i,i)
end
print(out)

Then you can use the outputted code with loadstring. Though I advise against doing this, as running the output through print() will output the real source again.

Ad

Answer this question