I can't find the error in LUA accmanager.lua:152: 'end' expected (to close 'function' at line 141) near '='

Viewed 38

I have this script but I don't know where the error could someone help me to find it I can't find the error in LUA accmanager.lua:152: 'end' expected (to close 'function' at line 141) near '=' and solve it thanks so much this is the whole code https://wtools.io/paste-code/bELp

AccountManager.createRecoveryKey = function(self) -- line 141
    local key = ""
    local seq1 = math.random(3,9)
    math.randomseed(os.time()*os.time())
    local seq2 = math.random(3,9)
    key = tostring(math.floor((seq1 ^ seq2)))
    key = key .."".. encryptionKey[seq1] .."".. encryptionKey[seq2]
    repeat
        local rnd = math.random(0,9)
        key = key .."".. tostring(rnd)
    until string.len(key) >= 15
    return self.mask.recKey = key -- line 152
end
1 Answers

The problem is return self.mask.recKey = key. Assignments in expressions aren't allowed in Lua. Do self.mask.recKey = key followed by return key instead.

Related