• 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!

TFS 1.X+ Attempt to compare nil with number

peteralto

Member
Joined
Nov 1, 2020
Messages
93
Solutions
1
Reaction score
17
This appears when this boss (World Devourer) tries to create the summons:

Code:
Lua Script Error: [Spell Interface]
data/spells/scripts/monster/devourer summon.lua:onCastSpell
data/spells/scripts/monster/devourer summon.lua:13: attempt to compare nil with number
stack traceback:
    [C]: in function '__lt'
    data/spells/scripts/monster/devourer summon.lua:13: in function <data/spells/scripts/monster/devourer summon.lua:8>

Here is the code of data\spells\scripts\monster\devourer summon.lua

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_NONE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_NONE)

local area = createCombatArea(AREA_CIRCLE2X2)
combat:setArea(area)

function onCastSpell(creature, var)

    local creatures = {"Greed", "Frenzy", "Disruption"}
    local monster = creatures[math.random(#creatures)]

    if devourerSummon < 3 then
        Game.createMonster(monster, {x=creature:getPosition().x+math.random(-1, 1), y=creature:getPosition().y+math.random(-1, 1), z=creature:getPosition().z}, false, true)
        devourerSummon = devourerSummon + 1
    end

    return combat:execute(creature, var)
end
 
Where did you declare it? It should look like:
local devourerSummon
or even initialize it
local devourerSummon = 0
 
Last edited:
Back
Top