I’m learning Lua but I got this error attempt to index a number value when compiler reach this piece of code
if a() == -1 then return code end
i tried to change the type of return from number to boolean but i got the same error
Boolean console error
function a() local message = developer:historicalMessage(22) if message == nil or message == nil then return nil end message = message if message.subs == 0 then global:printMessage("Here !") return -1 end end function Notif() if a() == -1 then return code end end
You haven’t told us the line, but there are only a few indexing operations:
global:printMessage(...)are presumably not the cause. If
globalwere numbers, they could be however. That seems unlikely to me as they are being used as "method tables" though (probably with metatables).
message.subsmight be indexing the number
developer:historicalMessage(22)is a number.
Answered By – LMD
Answer Checked By – Cary Denson (BugsFixing Admin)