Hello I edited a script by myself but it does not work as I thought
so I need quick ur help
I tried to make a manarune which heals different for every vocation. as explain Knight heals 300k mana and mage heals 700k mana but for some reasons the script does not work and I dont know why. ( no errors in console ) im using tfs 0.4
Hopefully someone can help me with this
I tried to make a manarune which heals different for every vocation. as explain Knight heals 300k mana and mage heals 700k mana but for some reasons the script does not work and I dont know why. ( no errors in console ) im using tfs 0.4
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 750) -- time in seconds x1000
function onUse(cid, item, fromPosition, itemEx, toPosition)
if exhaustion.check(cid, 4905) then
doPlayerSendCancel(cid, "You cant heal when you got freezed.")
return true
end
if hasCondition(cid, CONDITION_EXHAUST) then
return true
end
if not isPlayer(itemEx.uid) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You may only use this on players!")
return true
end
if playerVoc == 1 then
local pos = getThingPos(itemEx.uid)
local kolor = 210 -- kolor napisu
doPlayerAddMana(itemEx.uid, 250000)
doSendMagicEffect(getThingPos(itemEx.uid), 31)
doSendAnimatedText(getPlayerPosition(itemEx.uid),"+"..mana_add.."",kolor)
doAddCondition(cid, exhaust)
elseif playerVoc == 2 then
local pos = getThingPos(itemEx.uid)
local kolor = 210 -- kolor napisu
doPlayerAddMana(itemEx.uid, 250000)
doSendMagicEffect(getThingPos(itemEx.uid), 31)
doSendAnimatedText(getPlayerPosition(itemEx.uid),"+"..mana_add.."",kolor)
doAddCondition(cid, exhaust)
elseif playerVoc == 3 then
local pos = getThingPos(itemEx.uid)
local kolor = 210 -- kolor napisu
doPlayerAddMana(itemEx.uid, 250000)
doSendMagicEffect(getThingPos(itemEx.uid), 31)
doSendAnimatedText(getPlayerPosition(itemEx.uid),"+"..mana_add.."",kolor)
doAddCondition(cid, exhaust)
elseif playerVoc == 4 then
local pos = getThingPos(itemEx.uid)
local kolor = 210 -- kolor napisu
doPlayerAddMana(itemEx.uid, 210000)
doSendMagicEffect(getThingPos(itemEx.uid), 31)
doSendAnimatedText(getPlayerPosition(itemEx.uid),"+"..mana_add.."",kolor)
doAddCondition(cid, exhaust)
end
return true
end
Hopefully someone can help me with this