Hello everyone, i need help defining my target on a spell, it goes like this:
so yeah i do that and the server send me an error saying it couldnt find the creature >.<
I've also tried whit doTargetCombatHealth() same result...
Help me please u.u and ty for reading.
Code:
local pos = getPosByDir(getCreaturePosition(cid), getCreatureLookDirection(cid), 1)
local target = getTopCreature(pos)
local lvl, ml = getPlayerLevel(cid), getPlayerMagLevel(cid)
local h1, h2 = ((((lvl * 3) / 2) + (ml * 4)) + 10), ((((lvl * 3) / 2) + (ml * 4)) + 20)
local hAmount = math.random(h1,h2)
bla bla bla bla bla
--and then i need to do this--
doCreatureAddHealth(target, hAmount)
so yeah i do that and the server send me an error saying it couldnt find the creature >.<
Code:
[Error - Spell Interface]
mods/scripts/customspells/dark purification.lua:onCastSpell
Description:
(luaDoCreatuReAddHealth) Creature not found
I've also tried whit doTargetCombatHealth() same result...
Code:
[Error - Spell Interface]
mods/scripts/customspells/dark purification.lua:onCastSpell
Description:
(luaDoTargetCombatHealth) Creature not found
Help me please u.u and ty for reading.