• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Problem paladin rune

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
923
Location
Chile
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
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 :(
 
@Thorn
Which server do you use?
The script you posted is for (Mystic Spirit) 9.1+

If you are still using Crying Damson 8.6, then use the ones in the thread for the lower TFS 0.3 client versions or remove the line with doPlayerSendTextMessage.
 
@Thorn
Which server do you use?
The script you posted is for (Mystic Spirit) 9.1+

If you are still using Crying Damson 8.6, then use the ones in the thread for the lower TFS 0.3 client versions or remove the line with doPlayerSendTextMessage.
He PMed me and I told him that. Some of the functions in the script aren't used for his server version. He's using the 0.4 DEV version for 8.6.
 
Back
Top