I would like to request action that would be simuliar the one lottery ticket. Its like, you use item, and than you get winning lottery ticket(item nr 1) or loose(item nr 2) I am totally a noob in lua, so I couldnt figure it out myself. It has something to do with mathrandom I think... Ehh, w/e
Here is the piggybank script(a bit simuliar) so it would be nice if someone modified it or told me how to do it:
Here is the piggybank script(a bit simuliar) so it would be nice if someone modified it or told me how to do it:
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if math.random(1, 6) == 1 then
doSendMagicEffect(fromPosition, CONST_ME_POFF)
doPlayerAddItem(cid, ITEM_GOLD_COIN, 1)
doTransformItem(item.uid, 2115)
else
doSendMagicEffect(fromPosition, CONST_ME_SOUND_YELLOW)
doPlayerAddItem(cid, ITEM_PLATINUM_COIN, 1)
end
return TRUE
end