Garry's Mod

Garry's Mod

33 ratings
NPC Buyers
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Server content
Addon Tags: Fun, Roleplay
File Size
Posted
3.301 KB
13 Nov, 2016 @ 3:51pm
1 Change Note ( view )

Subscribe to download
NPC Buyers

Description
What is this?
NPC Buyers are npc's that purchase entities from you in DarkRP. This is very similar to the pawnshop npc in OC. As you sell and buy the buy price changes (see below).


How do I use them?
Just pick up a valid entity and touch it to them with the grav gun.

Why...?
This is definitely a niche addon. It is best used with things that produce entities over time, such as this plant. I recommend not using this with any entities purchasable from the f4 menu. That would result in money farming.

Features?
-Definable item database for purchasing
-Invincible "npcs"
-Seprate names and models per "npc"
-Saving and loading on map start
-DarkRP Themed 3D2D labels
-Miniature supply demand on npcs (As you buy from them their buy amount goes down, and increases slowly over time.)

Setup
Look where you want an npc and type in console:
drp_makebuyer <index from buyer table (see below)> <model> <name (shown on label)>
And if all went right you npc is created! Before you can save him, you need to place his label somewhere. Look where you want it and type:
drp_labpos
If you missplace, just run it again until you have it right.

Now that your npc and label are placed, finish up by typing:
drp_savenpcs
Now your npc will spawn on map start! To remove him, just hit him with your remove tool and run the save command again.

No picky, no clicky



How does I added moar items!
Adding more items is easy!

Just open up drpnpcshared.lua and add your item in following the previous entries as an example. Here is an addition of an npc that buys money printers (read warning above):
buyers = {
foodbuyer = { --name used in concommand
entclass = "food", --entity name
buyamt = 10, --base amount to buy for
flux = 1, --how much it changes up/down (0 to disable changing)
max = 15, --if flux =/= 0 then minimun and maximun buy amounts
min = 5, -- ^^
nicename = "Chinese Food" -- nice name show, shows as "Buying xxx"
},
akbuyer = {
entclass = "spawned_weapon",
buyamt = 250,
flux = 5,
max = 300,
min = 225,
requiredvars = {weaponclass = "weapon_ak472"}, --ADVANCED: If your entity has extra variables, this will check them (server side)
nicename = "Ak-47's"
},
melonbuyer = {
entclass = "spawned_food",
buyamt = 5,
flux = 0, --disable changin of price so we dont need min/max
requiredmodel = "models/props_junk/watermelon01.mdl", --ADVANCED: only buy entites with the correct model
nicename = "Melons"
},
printerbuyer = {
entclass = "money_printer",
buyamt = 500,
flux = 25,
max = 800,
min = 200,
nicename = "Money Printers"
}
}

What next?
I would like to make a list of purchasable items and allow them to be sold to a single npc, however I don't see any non bug fixing updates unless people show an interest in this.


Also, if anyone finds any bugs, please report them here.
13 Comments
[RE] Flameoguide 28 Apr, 2022 @ 5:31pm 
This would be really good for a lot of servers. If someone is willing to fix the addon and upload it to the workshop, they'd be doing everyone a big favor.
MasaM X 25 Jan, 2022 @ 5:00pm 
Hello! I know it's been a long time, but do you have a working version of this addon? I need it for my darkrp server. Thanks
Joshua  [author] 19 Jun, 2021 @ 2:32am 
This addon is not directly supported by Gmod or myself anymore.
delay lama 17 Jun, 2021 @ 6:05am 
I fixed this addon (for the most part)
The cake is a lie! 15 Feb, 2021 @ 5:00am 
Why you did choose a black man as the drug dealer for this?!:Lindon:
Douglas 6 Jan, 2020 @ 5:01pm 
I was able to fix this script message me if you need help to do the same.
Aku! 5 Jul, 2019 @ 10:35pm 
damn, i really need one of these and this is the only one on the workshop D:
Gulag Gunner 30 Jun, 2019 @ 9:19pm 
So it no longer works correct?
Joshua  [author] 2 Mar, 2018 @ 10:44am 
guys, i closed this all down.. wow..
[TEPU] Furious Socks 2 Mar, 2018 @ 10:43am 
not working!