Maybe your string inside ([[ ]])) is too long. Error log says 'expression too complex'?
To fix that issue you can try to split the string, then concatenate them.
I'll give you an example obsfucate function. It is not protect the scripts from log hooking, but the purposes is, to slower any 'leaker' convert back your code to full original text using tools like unluac or sstool.
--encode
function strToBytes(str)
local byteArray= { str:byte(1, -1) }
for i = 1, #byteArray do
byteArray[i] = byteArray[i] + 100
encoded = '{' ..table.concat(byteArray, ',') .. '}'
encoded = 'bytesToStr(' ..encoded .. ')'
encoded = 'string.dump(load('..encoded..'),true,true)'
encoded = 'load('..encoded..')()\n'
end
return encoded
end
--decode
function bytesToStr(byteArray)
local output = ""
for _,b in ipairs(byteArray) do
output = output .. string.char(b - 100)
end return output
end