Thorn
Spriting since 2013
Hii, well i have a paladin rune wich heals mana and hp
well when i use it (with GOD or with normal player) it gives me this error :S
here is the lua
plzz guys help me
well when i use it (with GOD or with normal player) it gives me this error :S
Code:
[04/09/2013 20:14:07] [Error - Action Interface]
[04/09/2013 20:14:07] data/actions/scripts/palyrune.lua:onUse
[04/09/2013 20:14:07] Description:
[04/09/2013 20:14:07] (luaDoPlayerSendTextMessage) Player not found
here is the lua
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000) -- time in seconds x1000
function onUse(cid, item, fromPosition, itemEx, toPosition)
local hpmax, manamax = getCreatureMaxHealth(cid), getPlayerMaxMana(cid)
local minhp, maxhp = 8, 10 -- this means 3% minimum hp healing and 5% maximum hp healing
local minmana, maxmana = 7, 8 -- this means 3% minimum mana healing and 5% maximum mana healing
local hp_add, mana_add = math.random((hpmax * (minhp/100)), (hpmax * (maxhp/100))), math.random((manamax * (minmana/100)), (manamax * (maxmana/100)))
if(getCreatureCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE) then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted")
return true
end
doCreatureAddHealth(cid, hp_add)
doPlayerAddMana(cid, mana_add)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doPlayerSendTextMessage(cid, MESSAGE_EXPERIENCE, "+"..math.floor(hp_add).." health and +"..math.floor(mana_add).." mana", getCreaturePosition(cid), hp_add, TEXTCOLOR_GREEN)
doAddCondition(cid, exhaust)
return true
end
plzz guys help me