Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onUse(cid, item)
- local itemWin, itemWinCount = 2394, 10
- local itemRemove, itemRemoveCount = 2160, 10
- local messageBuy = "You have purchased " .. itemWinCount .. " " .. getItemNameById(itemWin) .. "."
- local messageNoHaveItem = "Sorry, you need " .. itemRemoveCount .. " " .. getItemNameById(itemRemove) .. " to buy this."
- if doPlayerRemoveItem(cid, itemRemove, itemRemoveCount) then
- doPlayerSendTextMessage(cid, 27, messageBuy)
- doPlayerAddItem(cid, itemWin, itemWinCount)
- doSendMagicEffect(getThingPos(cid), math.random(28, 30)
- else
- doPlayerSendCancel(cid, messageNoHaveItem)
- doSendMagicEffect(getThingPos(cid), 9)
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement