Advertisement
Guest User

Untitled

a guest
Oct 21st, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. local config = {
  2. rate = 50,
  3. time = 60, -- AQUI É QUANTOS MINUTOS VAI FICAR O DOUBLE
  4. storage = 21002
  5. }
  6. local function endExpRate(cid)
  7. if isPlayer(cid) == TRUE then
  8. doPlayerSetRate(cid, SKILLLEVEL, 1)
  9. setPlayerStorageValue(cid, config.storage, -1)
  10. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "O efeito da Double Exp Potion acabou!")
  11. end
  12. end
  13. function onUse(cid, item, fromPosition, itemEx, toPosition)
  14. if(getPlayerStorageValue(cid, config.storage) < 0) then
  15. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua experiencia foi dobrada durante ".. config.time .." minutos.")
  16. doSendMagicEffect(getPlayerPosition(cid), 28)
  17. doCreatureSay(cid,'Double Experience Actived!', TALKTYPE_ORANGE_1)
  18. doPlayerSetRate(cid, SKILLLEVEL, config.rate)
  19. setPlayerStorageValue(cid, config.storage, os.time() + config.time * 60)
  20. addEvent(endExpRate, config.time * 60 * 60, cid)
  21. doRemoveItem(item.uid, 1)
  22. else
  23. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você ainda está sob o efeito da Double Exp Potion, espere acabar o tempo para usa-la novamente.")
  24. end
  25. return TRUE
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement