Thorn
Spriting since 2013
hello guys, i want an item that can only be used a X amount of times, in this case 4, plz guys can you help me achieve this?
i use otx 2.52 version 9.83
here is an item who gives sword skill lvl, so you can see why i want it limitated hehe
i use otx 2.52 version 9.83
here is an item who gives sword skill lvl, so you can see why i want it limitated hehe
Code:
local skill, amount = SKILL_SWORD, 3 --Edit skill name Ex: SKILL_CLUB,1 = that means amount so, it add now 1 sword fighting.
function onUse(cid, item, fromPosition, itemEx, toPosition)
for i = 1, amount do
doPlayerAddSkillTry(cid, skill, (getPlayerRequiredSkillTries(cid, skill, getPlayerSkillLevel(cid, skill) + 1) - getPlayerSkillTries(cid, skill)), false)
end
doSendMagicEffect(getThingPos(cid),math.random(CONST_ME_FIREWORK_YELLOW, CONST_ME_FIREWORK_BLUE))
doCreatureSay(cid, "SKILL UP!", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
return true
end