0.4
Hello everyone, I'm doing some custom spells for my monsters, and one particular spell is: It begins to 'charge' and then hit the player (one target), but, if the player disappears (logout or die), it will return this error:
It is this part (inside onCastSpell):
As you can see, I tried to use a "check", to see if the player exist, but no luck
Hello everyone, I'm doing some custom spells for my monsters, and one particular spell is: It begins to 'charge' and then hit the player (one target), but, if the player disappears (logout or die), it will return this error:
[2/4/2022 13:41:48] [Error - Spell Interface]
[2/4/2022 13:41:48] In a timer event called from:
[2/4/2022 13:41:48] data/spells/scripts/monsters/throw rock.lua: onCastSpell
[2/4/2022 13:41:48] Description:
[2/4/2022 13:41:48] (luaGetThingPosition) Thing not found
[2/4/2022 13:41:49] [Error - Spell Interface]
[2/4/2022 13:41:49] In a timer event called from:
[2/4/2022 13:41:49] data/spells/scripts/monsters/throw rock.lua: onCastSpell
[2/4/2022 13:41:49] Description:
[2/4/2022 13:41:49] attempt to index a function value
[2/4/2022 13:41:49] stack traceback:
[2/4/2022 13:41:49] [C]: in function 'doSendDistanceShoot'
[2/4/2022 13:41:49] data/spells/scripts/monsters/throw rock.lua:28: in function <data/spells/scripts/monsters/throw rock.lua:23>
It is this part (inside onCastSpell):
C++:
addEvent(function()
if isCreature(cid) then
if getCreatureTarget(cid) == isMonster or isCreature then
doSendDistanceShoot(getThingPos, getCreaturePosition(target), 11)
return doTargetCombatHealth(cid, getCreatureTarget(cid), COMBAT_PHYSICALDAMAGE, -75, -95, 9)
end
end
end, 2000)
end
As you can see, I tried to use a "check", to see if the player exist, but no luck