Skip to content

Coffeelot/cw-trading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 

Repository files navigation

cw-trading 🤝

Package of two scripts to allow NPCs that trade items to other items or cash.

Ever felt like your QB server really needs someone who trades burritos for meth? or burgers for fried chicken? We gotcha! Easy setup. You only need to modify and add to the config files.

Developed by Coffeelot and Wuggie

More scripts by us 👈

Support, updates and script previews:

Join The discord!

All our scripts are and will remain free. If you want to support what we do, you can buy us a coffee here:

Buy Us a Coffee

Preview

Video

How to use cw-traders 🛒

This script creates physical traders that uses the cw-trade script to. All you need to do is add the traders in the config.lua. Uses qb-target.

Using with cw-tokens 🔑

At the top of the Config you will find Config.UseTokens = false. Change false to true if you want to use cw-tokens.

Trader objects

name: Variable name of the trader. Needs to be unique.
model: the model of the character (see link below)
tradeLabel: What shows up in game
tradeName: needs to match the unique variable name of the trade in cw-trades config that you want to use
coords: location of the trader
animation: How many items the traders gives (see link below)
available = {from, to}: This is optional! If you add this, the trader will only do the trade in the given timespan

ped models
animation pastebin

How to use cw-trade 💰

This script creates trades for cw-traders. All you need to do is add the trades in the config.lua. The script is separated so that you can use the same events for other

If you want to use rep and repType you need mz-skills. Otherwise REMOVE THESE PROPERTIES from your trades.

Trade objects

tradeName: Variable name of the trade. Needs to be unique.
fromItem: Variable name of the item the player give the trader (found in items.lua in qbcore)
fromAmount: How many items the traders takes
toItem: Variable name of the item the trader give the player (found in items.lua in qbcore)
toAmount: How many items the traders gives
toCash = {to, from}: This is optional! If you add this, it will let the trader give the player cash in the span between to and from for the item toBills This is optional! If you add this, it will let the trader give the player money rolls ('rolls') in the span between to and from for the item. You will need to add these in the items.lua for it to work:

	["rolls"] 					 = {["name"] = "rolls", 			 	["label"] = "Roll Of Small Notes", 		        ["weight"] = 100, 		["type"] = "item", 		["image"] = "cash_roll.png", 				["unique"] = false, 		["useable"] = false,		["created"] = nil,		["decay"] = nil, 	["shouldClose"] = false,   ["combinable"] = nil,   ["description"] = "Roll of Small Notes"},

About

QB core based script for adding traders

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages