• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

NPC or Lever Shop That works with items instead of money

Tazzonny

The Bestest
Joined
Feb 8, 2009
Messages
161
Reaction score
2
I need an npc or lever shop system that will sell items for the item 9020 instead of regular gold coins, etc.
Any help is appreciated
 
Lua:
local coin = 9020 --coin id
local itan = 2195 --item for sale
local cname = getItemNameById(coin)
local iname = getItemNameById(itan)
function onUse(cid, item, frompos, item2, topos)
         if getPlayerItemCount(cid, coin) >= 30 then
            doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You bought '..iname..' for 30 '..cname..'"s)
            doPlayerAddItem(cid, itan)
            doPlayerRemoveItem(cid, coin, 30)
                                    elseif getPlayerItemCount(cid, coin) <= 29 then
                                  doSendMagicEffect(getThingPos(cid), CONST_ME_PUFF)
                                  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You don\'t have enough '..cname..'s to buy '..iname..'")
                     end
    return TRUE
end
 
Back
Top