• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

LOYALTY SYSTEM

jel

Member
Joined
Mar 22, 2014
Messages
302
Reaction score
12
Does anyone help me with this error?
Code:
Lua Script Error: [Event Interface]
data/events/scripts/player.lua:Player@onLook
data/events/scripts/player.lua:161: attempt to compare number with nil
stack traceback:
        [C]: in function '__le'
        data/events/scripts/player.lua:161: in function <data/events/scripts/pla
yer.lua:101>

Code:
if thing:isPlayer() then
    local loyalty = LOYALTY_STORAGE[thing.uid]
    for key = 1, #LOYALTY_TITLES do
        if loyalty >= LOYALTY_TITLES[key][1] then
            description = description .. (thing:getSex() == 0 and " She" or " He") .. " is a " .. LOYALTY_TITLES[key][2] .. " of ' .. configManager.getString(configKeys.SERVER_NAME) .. '."
            break
            end
        end
        end
 
likely that loyalty is nill
Lua:
if thing:isPlayer() then
    local loyalty = LOYALTY_STORAGE[thing:getId()]
    if loyalty == nil then
        print(thing:getName() .. " has nil loyalty.")
    end
    for key = 1, #LOYALTY_TITLES do
        if loyalty >= LOYALTY_TITLES[key][1] then
            description = description .. (thing:getSex() == 0 and " She" or " He") .. " is a " .. LOYALTY_TITLES[key][2] .. " of " .. configManager.getString(configKeys.SERVER_NAME) .. "."
            break
        end
    end
end
 
likely that loyalty is nill
Lua:
if thing:isPlayer() then
    local loyalty = LOYALTY_STORAGE[thing:getId()]
    if loyalty == nil then
        print(thing:getName() .. " has nil loyalty.")
    end
    for key = 1, #LOYALTY_TITLES do
        if loyalty >= LOYALTY_TITLES[key][1] then
            description = description .. (thing:getSex() == 0 and " She" or " He") .. " is a " .. LOYALTY_TITLES[key][2] .. " of " .. configManager.getString(configKeys.SERVER_NAME) .. "."
            break
        end
    end
end
error again
 
Does anyone help me with this error?
Code:
Lua Script Error: [Event Interface]
data/events/scripts/player.lua:Player@onLook
data/events/scripts/player.lua:161: attempt to compare number with nil
stack traceback:
        [C]: in function '__le'
        data/events/scripts/player.lua:161: in function <data/events/scripts/pla
yer.lua:101>

Code:
if thing:isPlayer() then
    local loyalty = LOYALTY_STORAGE[thing.uid]
    for key = 1, #LOYALTY_TITLES do
        if loyalty >= LOYALTY_TITLES[key][1] then
            description = description .. (thing:getSex() == 0 and " She" or " He") .. " is a " .. LOYALTY_TITLES[key][2] .. " of ' .. configManager.getString(configKeys.SERVER_NAME) .. '."
            break
            end
        end
        end
Send full script... We can't find line 161 in a script that have only 9 lines...
 
Back
Top