dgprado
Member
Hello guys, i need a script that you use an item in x monster with a chance to brake the item, if you heave luck you take an outfit.
Can someone do this ?
thx.
Can someone do this ?
thx.
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isMonster(itemEx.uid) and getCreatureName(itemEx.uid) == 'Creature Name' then
if math.random(100) <= 50 then -- break chance
doRemoveItem(item.uid, 1)
doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
else
doRemoveCreature(itemEx.uid)
doSendMagicEffect(toPosition, CONST_ME_POFF)
doPlayerAddOutfit(cid, ID_OF_OUTFIT, 3)
end
return true
end
end