Guest User

Mount System - Usar item

a guest
Sep 19th, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.75 KB | None | 0 0
  1. function onUse(cid, item, fromPosition, itemEx, toPosition, item2)
  2. local t = {
  3. storage = 9467,
  4. mount = 100 -- ID DA MOUNT QUE VAI GANHAR!
  5. item = 1354 -- ID DO ITEM QUE O PLAYER VAI USAR NA MOUNT
  6. }
  7. if getPlayerStorageValue(cid, t.storage) == -1 then
  8.     if item2.uid == t.item then
  9.         doPlayerAddMount(cid, t.mount)
  10.         doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Parabéns, você ganhou uma mount!")
  11.         doSendMagicEffect(getCreaturePosition(cid),29)
  12.         doPlayerSetStorageValue(cid, t.storage, 1)
  13.     else
  14.         doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Esta não é a mount certa.")
  15.     end
  16. else
  17.     doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Desculpe, Você ja ganhou a mount!")
  18.     doSendMagicEffect(getCreaturePosition(cid),2)
  19. end
  20. return TRUE
  21. end
Advertisement
Add Comment
Please, Sign In to add comment