Advertisement
LuckOake

Quiz Action

Dec 23rd, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. function onUse(cid, item, frompos, item2, topos)
  2.     a = {
  3.         [8910] = {{2160, 10}, {12604, 1}},
  4.         [8911] = {{12603, 1}, {12604, 1}},
  5.         [8912] = {{12603, 1}, {12604, 1}},
  6.         [8913] = {{12603, 1}, {12604, 1}},
  7.     }
  8.    
  9.     b = a[item.uid]
  10.    
  11.     r = math.random(1, #b+1)
  12.    
  13.     if r == #b+1 then
  14.         doPlayerSendTextMessage(cid,22,"Sua bag rasgou.")
  15.     else
  16.         doPlayerAddItem(cid, b[r][1], b[r][2])
  17.         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você ganhou "..b[r][2].."x "..getItemNameById(b[r][1])..".")
  18.     end
  19.         doRemoveItem(item.uid)
  20. return true
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement