Garry's Mod

Garry's Mod

VendR - Customizable Vending Machines
51 Comments
tewg 15 Dec, 2024 @ 12:19pm 
Nvm, figured it out.

Heres the code if anyone wants it too.


itemList = {
"weapon_crowbar",
"weapon_pistol"
}

VSHARE.item.ClassID = itemList[math.random(1, #itemList)]
return
tewg 15 Dec, 2024 @ 12:10pm 
Is there any way i could make it drop a random item instead of a pre-determined one?
salter 29 Aug, 2021 @ 10:15am 
when i press buy, nothing happens, and i get this error

buying item 1 in category 1

[VendR - Customizable Vending Machines] lua/entities/ser_vender/init.lua:154: attempt to index a nil value
1. CreateWeapon - lua/entities/ser_vender/init.lua:154
2. func - lua/entities/ser_vender/init.lua:120
3. unknown - lua/includes/extensions/net.lua:32
Xirtlem 27 May, 2021 @ 10:03am 
anyone know how to change it to work with things like say, zombie survival money? im not at all a coder but would love to know what i do if possible.
Dave_Sherk 25 Jan, 2021 @ 12:35pm 
How to configure what type of value it takes? I'm using Sandbox Money mod type
Bob 25 Aug, 2019 @ 3:00pm 
when i press buy it takes my money
urethrat 23 Aug, 2019 @ 8:25am 
can you make this for a none dedicated (think thats the right word)
officereso 24 Jun, 2019 @ 4:34pm 
how do i make the entities produces by the machine able to be picked up by the gravity gun.
hyperjll 30 Mar, 2019 @ 7:30pm 
Please make a version for sandbox, this looks really fun. :(
Puw 27 Dec, 2018 @ 7:09am 
*played Borderlands 2 for more than 800 Hours* Hmm, Seems Familiar
Nihil 3 Sep, 2018 @ 10:00am 
Does This Addon Work's For The Sandbox Gamemode?
Sadist 29 May, 2018 @ 10:31am 
Please, make support PointShop (for use on SandBox) :)))
>KB> >KEKSQUAD 23 Mar, 2018 @ 8:27pm 
[ERROR] lua/entities/ser_vender/shared.lua:366: attempt to index local 'v' (a nil value)
1. CreateValueEditor - lua/entities/ser_vender/shared.lua:366
2. LoadItems - lua/entities/ser_vender/shared.lua:235
3. OnRowSelected - lua/entities/ser_vender/shared.lua:488
4. OnClickLine - lua/vgui/dlistview.lua:422
5. unknown - lua/vgui/dlistview_line.lua:81

Happens whenever I make a new category.
>KB> >KEKSQUAD 23 Mar, 2018 @ 7:55pm 
Hey, how would we go about using it with Vrondakis' levelling system? We only want certain items accessible to certain levels and ULX ranks.
SpiriT 25 Jan, 2018 @ 7:24am 
How to remove vending machine from the server?
Simone 18 Jan, 2018 @ 5:23pm 
Thank you for dealing with the filthy masses.
DevonSFM 5 Jan, 2018 @ 1:08pm 
thats a lot to read. ill just delete it cuz its to hard :)
Merc 14 Dec, 2017 @ 9:14am 
how to make it give weapons? too hard for me! make instruction
Dax 25 Nov, 2017 @ 6:50pm 
how do you spawn it
Billward 11 Nov, 2017 @ 3:07pm 
soooooooo what do you use as currency?

I make everything free but just curious
scarybarry14 8 Oct, 2017 @ 7:43pm 
I get errors is there anything you need to get a texter pack for example to make it work
Soma 19 Aug, 2017 @ 2:27am 
This is a fantastic addon so far! thank you for your work on it! I do have a question though: How come I can't use the gravgun to pick up items that get dispensed from the vending machine?
Animawesome 26 Jul, 2017 @ 7:20pm 
Hey how would you make this use pointshop points ? anyone know ?
-snip- 16 Jul, 2017 @ 11:30am 
I have a problem. If you walk out of the visible range of the screen, and then come back, you can't use it. Help please?
witch 2 May, 2017 @ 3:12pm 
Does this work in sandbox?
Simone 12 Mar, 2017 @ 5:26pm 
[ERROR] addons/vendr/lua/entities/ser_vender/shared.lua:367: attempt to index local 'v' (a nil value)
1. CreateValueEditor - addons/vendr/lua/entities/ser_vender/shared.lua:367
2. LoadItems - addons/vendr/lua/entities/ser_vender/shared.lua:236
3. OnRowSelected - addons/vendr/lua/entities/ser_vender/shared.lua:489
4. OnClickLine - lua/vgui/dlistview.lua:422
5. unknown - lua/vgui/dlistview_line.lua:81

This is another error. It happens if I'm editing the machine and already have persistence enabled; if I leave the editor, this error comes and everything is cleared.
Simone 12 Mar, 2017 @ 5:26pm 
[ERROR] addons/vendr/lua/entities/ser_vender/init.lua:154: attempt to index a nil value
1. CreateWeapon - addons/vendr/lua/entities/ser_vender/init.lua:154
2. func - addons/vendr/lua/entities/ser_vender/init.lua:120
3. unknown - lua/includes/extensions/net.lua:32

I see where you addressed it earlier, saying that an item must be broken. This can't the case, though, because all of my items (including vanilla ones) create this error.
Dan Ween 4 Jan, 2017 @ 6:20pm 
[VendR - Customizable Vending Machines] lua/entities/bullet/init.lua:18: attempt to compare nil with number
1. v - lua/entities/bullet/init.lua:18
2. unknown - lua/includes/modules/hook.lua:84

help please
i cant spawn anything
ataraxia 10 Dec, 2016 @ 8:14am 
Bugs

[VendR - Customizable Vending Machines] lua/entities/ser_vender/init.lua:127: attempt to call method 'CPPIGetOwner' (a nil value)
1. func - lua/entities/ser_vender/init.lua:127
2. unknown - lua/includes/extensions/net.lua:32

I get this everytime I exit out of the customization menu,
And once after that error all of my weapons except the first one I've created disappeared in my category, though it didnt happen again since and I cant make that happen again .

Suggestions
--If you close the customization menu all of the other input boxes (for typing weapon name etc.) should also close (if possible).
--Maybe add a cvar for changing the delay of the weapon coming out of the machine
--Make settings tab (during customization) refresh itself when enabling/disabling persisting or at least add some text to remind you to press settings.

Overall, this mod is freaking awesome and has a LOT of potential. Keep updating it and keep up the good work!

Liked+Favorited
Theon1yDoctor 1 Dec, 2016 @ 5:13pm 
I can't type in a category name... need help plz
Theon1yDoctor 25 Nov, 2016 @ 7:33pm 
I can't type in a category name... need help plz
smashguns 21 Nov, 2016 @ 1:20pm 
when i spawn a entity how come i cant pick it up with my gav or phys gun?
moka 18 Nov, 2016 @ 5:25pm 
How do you get money if you are using this for single player and you want to get cash for kills
CEPHY 29 Oct, 2016 @ 7:42pm 
Forget that, apparently a bullet physics mod SOMEHOW thought your mod is going nuts...
CEPHY 29 Oct, 2016 @ 6:45pm 
What the hell? My game is telling me that your addon is creating errors, BUT I DON'T EVEN HAVE IT INSTALLED?

I didn't even know that this exists! What is going on!
Seris  [author] 17 Oct, 2016 @ 10:20am 
I already wrote an add-on that does that, but it's on my server only atm.
Seris  [author] 17 Oct, 2016 @ 9:57am 
It works fine in sandbox with some tweaks. Use CLua to test if the player has the right amount of money. You could even make it take point shop points for all I care
Mumshroom 17 Oct, 2016 @ 8:38am 
Dude, this is meant for darkrp. You can just have a buildrp server.
Seris  [author] 16 Oct, 2016 @ 8:21am 
Yes, though you will need to set it up in a specific way using CLua. Set the class I'd to prop_physics and then use a timer to set the model of the prop and reinitialize it's physics
Seris  [author] 13 Oct, 2016 @ 9:41am 
I'm considering moving to using luapad as the CLua entry solution, but this will either require me to bundle it with the addon (i dont want to do this) or you will have to subscribe to luapad on your server. This is what my current test revision looks like right now: screenshot
Seris  [author] 9 Oct, 2016 @ 9:15am 
One of your item entries is messed up, try again with a different item.
Tos 9 Oct, 2016 @ 1:54am 
[VendR - Customizable Vending Machines] lua/entities/ser_vender/init.lua:154: attempt to index a nil value
1. CreateWeapon - lua/entities/ser_vender/init.lua:154
2. func - lua/entities/ser_vender/init.lua:120
3. unknown - lua/includes/extensions/net.lua:32
Seris  [author] 6 Oct, 2016 @ 12:16am 
And Revocity, this was originally intended to be sold on SF, but they kept denying the script for the same reason even after i fixed the error. I gave up and uploaded it here instead
Seris  [author] 6 Oct, 2016 @ 12:15am 
If any of you were wondering how you can cheat the system a bit and copy vending machines without having to set them up all over again, simply set up a single vending machine how you want, then sync the changes, and move it to wherever you want more to be, change the name, and sync the changes. this will effectively duplicate the vending machine.
Yukami Nee-san 5 Oct, 2016 @ 8:24am 
Finally something that not with high af price on scriptfodder, nice job
Jorsan Seagull 4 Oct, 2016 @ 2:35pm 
now that i know how to use it this addon is REALLY COOL
Jorsan Seagull 4 Oct, 2016 @ 1:54pm 
ok
Seris  [author] 4 Oct, 2016 @ 1:53pm 
right click on an entity in the weapons or entities tab and click copy to clipboard
Jorsan Seagull 4 Oct, 2016 @ 1:39pm 
how do you find the class name for stuff so you know what to put in the ClassID blank
Catzzy :3 30 Sep, 2016 @ 6:56pm 
pretty great :D