Procedural Modern Vending Machine (P.M.V.M)

Almost a week ago me and my friend wanted to make a vending machine, so here we are. The vending machine is fully procedural with settings for practically everything that could be customized within the machine. Sound effects are included, but are toggleable and customizable. The body itself is split into two sections (makes recoloring a breeze).


Vending Machine in action:


Settings
------ Restocking -------------------------
CanRestock = true, -- true default, disable if you dont want the machine to automatically restock
RandomizeProductsWhenRestocking = true, -- true default
RestockTime = 300, -- 300 default, time is in seconds so 300 is 5 minutes roughly
-------------------------------------------

------ Vending ----------------------------
CanVend = true, -- true default, basically bricks the vending machine. cant dispense products though it will load them. good if you want just a prop
VendingAnimationTime = 1, -- 1 default, speed that it dispenses the gear in seconds.
-------------------------------------------

------ Cash Animation----------------------
DisableRobuxInsertAnimation = false, -- false default, disables the coins and robux animation thingy
CoinDispensingEnabled = true, -- true default, disabling robux insert will also disable this.
CoinDispenseSpeed = .1, -- .1 default, in seconds
RobuxInsertSpeed = .75, -- .75 default, in seconds
-------------------------------------------

------ Screen -----------------------------
DisableScreenAnimation = false, -- false default, disables the falling items on the screen.
ScreenAnimationRate = .15, -- .15 default, in seconds
ScreenAnimationFallSpeed = 2, -- 2 default, in seconds
-------------------------------------------

------ Push Door --------------------------
PushDoorAutoCloses = true, -- true default, ignore setting below if set to false
TimePushDoorStaysOpen = 2, -- 2 default, in seconds
DoorOpeningSpeed = .5, -- .5 default, in seconds
DoorClosingSpeed = .4, -- .4 default, in seconds
-------------------------------------------

------ Product ----------------------------
GiveToolOnClick = true, -- true default, if disabled people wont be able to get tools from dispensed items
ProductDespawnTime = 15, -- 15 default, time it takes to despawn the product upon dispensing if nobody picks it up
-------------------------------------------

------ KeyPad -----------------------------
DisableSecretCommands = false, -- false default, commands are harmless fun / utility
-------------------------------------------


	--[[
		//////////////////////////////////////////////
		
					EXPERIMENTAL SETTINGS
				
			changing these settings has a high chance
			of breaking / messing up parts of the machine
		
		//////////////////////////////////////////////
	]]

------ KeyPad -----------------------------
MaximumKeypadLength = 2,
MaximumPressedHistory = 4,
-------------------------------------------

------ Screen -----------------------------
MinimumScreenImages = 10,
-------------------------------------------

------ Product ----------------------------
ToolDroppable = false, -- DO NOT ENABLE THIS UNLESS YOUR REALLY SURE, IT ESSENTIALLY TURNS THE VENDING MACHINE INTO A LAG MACHINE
-------------------------------------------

------ Sounds -----------------------------
    SoundsEnabled = true, -- true default, not sure why you would do this, disabling it wont break anything but eh
-------------------------------------------
Adding a new product to vending machine
--[[
	// HOW TO ADD A NEW PRODUCT TO THE VENDING MACHINE //
	
		First off, you'll need to get the asset id of a
		roblox gear. Lets take healing potion for example
		
		https://www.roblox.com/catalog/11419319/Healing-Potion
										
										↑↑↑↑↑↑
								This is the asset id, 
								copy and paste it.
								
		Then decide the price of the item! The price system
		works like this.
		
		---------------------------------------------
		Price 2 = 2 robux goes in, 0 coins come out
		Price 1.5 = 2 robux goes in, 5 coins come out
		Price 1.25 = 2 robux goes in, 2 coins come out
		Price 0 = no animation
		---------------------------------------------
		
		Its all procedural, meaning you can set the price 
		to anything you want!
		
		Although, if you dont like this feature you can
		disable it in settings. :(
		
		Now that we have our id and price, we just insert
		it into the Products module inside the vending machine
        like so.
		
		["Healing Potion"] = {
			Price = 1,
			AssetID = 11419319,
		},
		
		This vending machine should work for every gear small
		enough to fit inside a vending machine, although rarely 
		a gear might get stuck.
		
		Enjoy! - Volerien
	
	/////////////////////////////////////////////////////
]]
Secret Combinations (can be disabled in settings):
  • 432B - Turns the display rainbow and plays Mexican music.
    RobloxStudioBeta_QE3knuSt4d
  • ABC1 - Restocks the vending machine

Why a vending machine?
We don’t know. We wanted to make something.

Feel free to use it however you see fit. If this proves of any use to you, then we are happy.

You can find the link to the model here: Vending Machine
Created by @carslys & @Volerien

24 Likes

Really cool resource, gonna rip this one up for sure lol

2 Likes

i’ve always wanted to make a smooth vending machine and never had the skills to make one. this is amazing!!

2 Likes

Is there a way of modifying it so that it cost either like coins per product or Robuxs? Thanks … ooohh I see you have in the adding section it has robux? so that means they are prompted to buy via Robuxs?

Thanks

1 Like

To clarify, the robux and coin part are purely a visual animation there is no prompting to purchase.

you can make it only insert coins by having an amount less then 1 for the product price in the products module. E.G. .9 will dispense 9 coins, ect.

How would I modify this to make it pull products from a folder, instead of a AssetID?

It would make it easier to put Custom Gears in.

1 Like

I’ll make an alternative version that allows this tomorrow :+1:

1 Like

Oh! That is much more than I was expecting! Thank you so much! :smiling_face_with_tear::grin:

1 Like