whiteblXK
Active Member
Hello, I have problem with my spell, when I use it server show that error:
This is my onTargetCreature function:
and doPushCreature(target, cid)
I add this functions to my source:
doTileQueryAdd
getThingPosition
I use Devland 0.97b.
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.