massuco
Brazilian, sorry for my bad english XD
Hi there, i was trying to create one script for TFS 0.4
The player will use the knife (id 2556) on corpses.
If the player use a knife on minotaur corpses player will have a chance of win one item.
If the player use a knife on orc corpses player will have a chance of win one item.
THE PROBLEM IS, only the minotaur script works, the second part (orcs) make my distro close imediately.
Anyone can help me?
This is my script:
The player will use the knife (id 2556) on corpses.
If the player use a knife on minotaur corpses player will have a chance of win one item.
If the player use a knife on orc corpses player will have a chance of win one item.
THE PROBLEM IS, only the minotaur script works, the second part (orcs) make my distro close imediately.
Anyone can help me?
This is my script:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
-- Minotaur, Minotaur Archer, Minotaur Guard, Minotaur Mage
if (itemEx.itemid == 2830) or (itemEx.itemid == 2871) or (itemEx.itemid == 2876) or (itemEx.itemid == 2866)then
if(math.random(1,2) == 1) then
doPlayerAddItem(cid, 2571)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN)
doTransformItem(itemEx.uid, itemEx.itemid + 1)
else
doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
doTransformItem(itemEx.uid, itemEx.itemid + 1)
end
-- Orc, Orc Spearman, Orc Warrior, Orc Shaman, Orc Berserker, Orc Leader, Orc Warlord
elseif (itemEx.itemid == 2820) or (itemEx.itemid == 2920) or (itemEx.itemid == 2862) or (itemEx.itemid == 2860) or (itemEx.itemid == 2864) or (itemEx.itemid == 2938) or (itemEx.itemid == 2967) then
if(math.random(1,2) == 1) then
doPlayerAddItem(cid, 2572)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN)
doTransformItem(itemEx.uid, itemEx.itemid + 1)
else
doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
doTransformItem(itemEx.uid, itemEx.itemid + 1)
end
end
return true
end
Last edited: