Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local config = {
- [1445] = {
- str = 264017, -- Storage
- uses = 2, -- Quantas vezes pode usar o barril
- flask = 7636, -- ID flask
- potion = 7618 -- ID potion
- },
- [3365] = {
- str = 264028,
- uses = 2,
- flask = 7636,
- potion = 7620
- }
- }
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- local barrel = config[item.itemid]
- if barrel then
- if getPlayerStorageValue(cid, barrel.str) < barrel.uses then
- local flasks = getPlayerItemCount(cid, barrel.flask)
- if flasks > 0 then
- doPlayerRemoveItem(cid, barrel.flask, flasks)
- doPlayerAddItem(cid, barrel.potion, flasks)
- setPlayerStorageValue(cid, barrel.str, (getPlayerStorageValue(cid, barrel.str) + 1))
- else
- doPlayerSendTextMessage(cid, 27, "You don't have empty potion flasks.")
- end
- else
- doPlayerSendTextMessage(cid, 23, "It is empty.")
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement