[QB] qb_tk_selldrugs - Advanced Drug Selling to NPCs

qb_tk_selldrugs

[ Video ]
[ ESX version ]

About

  • Well-optimized

    • 0.00 ms | Idle
    • 0.06 ms | In usage (The draw text uses most of this)
  • Uses FiveM Asset Escrow system, but if there is anything you would like to get changed or added to the editable file, contact me and I can probably change it!

  • Features

    • Player selects a drug and gives a price
      • NPC will give a counter offer if asked price is not higher than set in config
        • The amount of drugs the NPC will buy depends on the player’s price
        • NPC’s counter offer’s price will be lower than the player’s
    • Player can accept or deny the NPC’s offer
    • NPCs have a configurable chance of calling the cops, which includes an animation
    • NPCs can rob the player (also configurable)
    • Can’t sell to the same NPC after selling to them once
    • Simple mode
      • Also includes a “simple mode” where the NPC will just buy a set amount of drugs for a random price between a min and a max value set in config
    • You can add more items, change prices & amounts, configure amount of police needed, change rob chance and amount & much more
Screenshots

1

2

Config

Requirements

Purchase (9.99€ + VAT)


My other QBCore Scripts


Code is accessible No
Subscription-based No
Lines (approximately) ~600
Requirements qb-core, qb-menu, qb-input, PolyZone, qb-target
Support Yes

Update 1.0.1

  • General bug fixes

Update 1.0.2

  • Fixed error with simple mode turned on

Update 1.0.3

  • Added function DrugsSold(src, item, amount price) to the editable server file

Update 1.0.4

  • Added a new config option Config.CanSellToMissionEntity

Update 1.1.0

  • Added a new config option Config.UseTarget, change the qb_target to a normal “DrawText”
  • Added possibility to retrieve the money back incase you are robbed

Is there a way for the npcs to come to you… so say start the cornering and just wait infront of a house and npcs will come up to you if interested?

No. Currently you will just have to walk up to any NPC and you are able to sell to all NPCs.

Update 1.1.1

  • Moved menus to editable client file

Update 1.1.3

  • Moved HasDrugs() function to editable client file

Update 1.1.4

  • Added a new config option Config.Account

Update 1.1.5

  • Fixed player items not being returned correctly on rare occasions

Update 1.1.6

  • Fixed sell drugs text not showing up after latest update

I get an error when starting the script

error parseing script in server.lua

I would try to fix but script is obstructed

Send me a dm with a screenshot of the error.

Update 1.1.7

  • Fixed player data not loading correctly

Update 1.1.8

  • Moved function AddTargetOption() to editable client file
  • Config.RobWeapon now accepts multiple weapons

Is anyone else having issues? The script just stopped working Ive tried everything even resintalling from scratch.

Hey! How exactly does it “not work”? Do you get any errors?

Update 1.1.9

  • Add GetItemAmount to editable server file