How to sell to NPC [ Not Corner Selling ] [QBCORE]

I’m looking for a simple solution / example of how to sell customizable items to an NPC. I have QB-Target set up and have replaced all of the shops with targeted peds. That works great for shops (buying) but how do I sell?

Should I be replicating the qb-pawnshop resource, for example? Are there already events for selling to NPCs, maybe something that came with qb-core that I’m missing?

I’m looking to create a stationary NPC ped, that players can go to, to sell a custom set of items. When looking this up I’m only seeing corner selling scripts

You could try pulling some code from qb-pawnshop

Sounds like that’s what you’re after, or similar?

1 Like

Yes, this is what I ended up doing thanks. I was thinking, with all the “Sell locations” I’ve seen across different servers, there’d be some built-in way of doing this.

Anyway I ended up doing just as you suggested. For future readers, I replicated (and renamed) the openPawn (client) event, inside the qb-pawnshop resource. Then referenced the event from my TargetModel in qb-target. I defined the products he’ll accept in the same qb-target init.lua file:

Config.AcceptedItems = {
  [1] = { ... },
  [2] = { ... },
}
3 Likes

can you share this . im looking to have a spot to sell stripped auto parts

1 Like

A share of this would be awesome, looking for a similar thing myself

1 Like

A share would be awesome

1 Like

I would be happy to have this if i have to pay ofc

1 Like

any update?