Signup Now
Results 1 to 1 of 1

Thread: npc sell items

  1. #1
    Free User Akiller's Avatar
    Join Date
    Aug 2015
    Posts
    240
    Reputation
    33
    Rep Power
    18

    npc sell items

    you got choice between list and category:



    provide cattegory from looting
    npcsellitems('is')


    provide list of items
    npcsellitems({'demon helmet','demon armor','demon legs'})


    function npcsellitems(tableorcategory)
    local args = tableorcategory
    if #args == 0 then
    printerror('incorrect argument provided')
    return false
    end
    if not ischannel('NPCs') then
    say('hi') wait(1000,1500)
    else
    npcsay('hi') wait(1000,1500)
    end
    npcsay('trade') waitping(2,4)
    if not $tradeopen then return false end
    if type(args) == 'table' then
    for _, k in ipairs(args) do
    while tradecount('sell', k) > 0 do
    sellitems(item, tradecount('sell',k))
    end
    end
    elseif type(args) == 'string' then
    foreach lootingitem m args do
    local itemdata = iteminfo(m.id)
    while tradecount('sell', itemdata.name) > 0 do
    sellitems(itemdata.name, tradecount('sell', itemdata.name))
    end
    end
    else
    printerror('incorrect type of argument')
    return false
    end
    end
    Last edited by Akiller; 07-07-2016 at 12:26 PM.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •