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

Attempt to index a boolean value in spell.

whiteblXK

Active Member
Joined
Apr 20, 2011
Messages
315
Solutions
9
Reaction score
32
Location
Poland
Hello, I have problem with my spell, when I use it server show that error:
Code:
Lua Script Error: [Spell Interface]
in callback: data/spells/scripts/Inferno.lua:onTargetCreature
(Unknown scriptfile)
attempt to index a boolean value

This is my onTargetCreature function:
Code:
function onTargetCreature(cid, target)
            doPushCreature(target, cid)
        return true
 end

and doPushCreature(target, cid)

Code:
local function doPushCreature(target, cid)
    if target > 0 then
        local position = getThingPosition(cid)
        local fromPosition = getThingPosition(target)
        local x = ((fromPosition.x - position.x) < 0 and -1 or ((fromPosition.x - position.x) == 0 and 0 or 1))
        local y = ((fromPosition.y - position.y) < 0 and -1 or ((fromPosition.y - position.y) == 0 and 0 or 1))
        local toPosition = {x = fromPosition.x + x, y = fromPosition.y + y, z = fromPosition.z}
        if doTileQueryAdd(target, toPosition) == 1 and getTileHouseInfo(toPosition) == 0 then
            doTeleportThing(target, toPosition)
        end
    end
    return true
end

I add this functions to my source:
doTileQueryAdd
getThingPosition


I use Devland 0.97b.
 
Back
Top