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

Lua Help defining my target on a spell...

DemShion

New Member
Joined
Apr 8, 2013
Messages
82
Reaction score
1
Location
Mexico
Hello everyone, i need help defining my target on a spell, it goes like this:
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.
 
Back
Top