Tibiamakers
yourolist.com
Someone can fix this script? i want that using the item 2157 [token] have a 25% to win 1 cc [ item id 2160 ]
the problem is that the script stoles you 1 token but never gives you money.
Thanks for help rep++
PHP:
function onUse(cid, item, frompos, item2, topos)
if item2.itemid == 8895 and
doPlayerRemoveItem (cid,2157,1) == 1 then
rand = math.random(1,2000)
if rand < 20 then
doPlayerRemoveItem (cid,2157,1)
doPlayerSendTextMessage(cid,9,"Maybe next time...")
doSendMagicEffect(topos,26)
doPlayerRemoveItem(cid,2160,4)
elseif rand >1100 and rand <1400 then
doPlayerRemoveItem(cid,2160,3)
doSendMagicEffect(topos,26)
doPlayerSendTextMessage(cid,9,"Maybe next time...")
elseif rand >300 and rand <600 then
doPlayerAddItem(cid,2160,4)
doSendMagicEffect(topos,26)
doPlayerSendTextMessage(cid,9,"You Win!.")
elseif rand >700 and rand <1000 then
doPlayerAddItem(cid,2160,3)
doSendMagicEffect(topos,26)
doPlayerSendTextMessage(cid,9,"You win!.")
end
else
doPlayerSendCancel(cid, "You need one token to play!.")
end
return 1
end
the problem is that the script stoles you 1 token but never gives you money.
Thanks for help rep++