What i mean is you have a scroll and use it 1/10 times you will get a premium account, 9/10 times you wont and the scroll will disappear. This is what i have so far
it works for the most part except i cant get more then 1-2 math.random to work, and when math.random = 2 the scroll wont do anything at all but when math.random = 1 everything works fine
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 8189 then
if math.random(1, 2) == 1 then
doPlayerAddPremiumDays(cid, 30)
doPlayerSendTextMessage(cid,22,"You received 30 days of Premium Account")
doSendMagicEffect(toPosition, CONST_ME_GIFT_WRAPS)
doRemoveItem(item.uid, 1)
end
else
if math.random(1, 2) == 2 then
doPlayerSendTextMessage(cid,22,"Sorry not a winner")
doSendMagicEffect(toPosition, CONST_ME_POFF)
doRemoveItem(item.uid, 1)
end
end
end
it works for the most part except i cant get more then 1-2 math.random to work, and when math.random = 2 the scroll wont do anything at all but when math.random = 1 everything works fine