Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local config = {
- itemOrg = 5432 --Item id of the item that is going to be used
- itemAdd = 1234 --Item id of the item that will be added
- itemRem = 9876 --Item id of the item that will be removed, considering it is a specific item
- }
- function onUse(cid, item, toPosition, itemEx, fromPosition)
- for i,v in pairs(config) do
- if itemEx.itemid == i then
- doPlayerAddItem(cid, config.itemAdd, 1)
- doRemoveItem(config.itemOrg, 1)
- doRemoveItem(cid, config.itemRem, 1)
- doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_GREEN)
- doSendAnimatedText(fromPosition, "Congratz!", COLOR_GREEN)
- doPlayerSendCancel(cid,"Successfully Crafted!")
- elseif
- not(itemEx.itemid) == i then
- doPlayerSendCancel(cid,"Sorry This item cannot be crafted.")
- doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment