[NO-F.W./ESX/QB] Vending Machines Script

This script makes me want to reinstall GTAV & FiveM just to see it working

3 Likes

yes :heart_eyes:

3 Likes

Can you make in future update after each vending machine purchase one of the society gets the money from it?

Config.PlaceVendings = {
prop_vend_snak_01 = {
vec4(459.8792, -992.0368, 23.9149, 93.7301)
},
mxc_vend_prop_svapo_01 = {
vec4(-497.4405, 277.5, 82.3123, 353.80)
},
}

Ex. here to change the config structure that each coordinate will belongs to one of the society.

3 Likes

yeah, really good idea!

2 Likes

We already have it ready, but it will be a different kind of script!

4 Likes

I would also consider making the vending machines a usable item, where whomever placed it can collect the money and refill the machine. you could also use an input menu for players to fill the machines with items from the config if they have them in their inventory, provided the machine was one that was either placed as a usable item or defined via coords in scripting.

The other ones that replace the models set via ymap would be automated and money would go into the void.

It would be really cool to define content options for the vending machine individually for diverse selections!

3 Likes

Is there a way to adjust the rotation of some props in the machine so they line up properly?

2 Likes

does this already replace all these objects on the entire map? or do I have to add this specific prop?

3 Likes

They replace some of the vanilla props. You can also add them via config.lua. In theory, you could ymap the vanilla props around the map to place these due to the nature of how replaces work.

2 Likes

yes i second this do a /refreshvendingmachine command

4 Likes

Added command “vending_refreshConfig”

4 Likes

we are back!

2 Likes

New update

  • Added debug mode (also hidden debug print if disabled)
  • Added command “vending_refreshConfig” to refresh the config while in game (so that you dont need to restart the script and crash)
  • Added support for targets (ox_target/qb-target)
  • Added readme.lua with items for ox_inventory and qb-core
  • Added utility_lib checker (checks that the utility lib is installed and provide instructions for download it)
5 Likes

Is it possible to set this up for a custom framework (one that is not ESX or QB)?

In the Config.Functions {} section, do we just set up the functions for giving items and taking money to match our framework? Can we also add in the effects on hunger, thirst, stress, etc? If we can configure all this ourselves, then shut up and take my money!

2 Likes

The status effects will depend on how your framework is written. This script doesn’t register any usable items, it only gives and takes items…

So, depending on where your items are registered, it appears from what I saw during configuring, enough is open for you to edit the add item and remove item and pay money functions.

Side note @MarKz would you consider releasing a free “placeholder” prop for mxc_vend_prop_svapo_01 so we can place it in codewalker ymapping without the use for scripting?

2 Likes

I use ND_Core and ox_inventory. There are no usable items, the status effects are triggered in ND_Status as an export upon use of the item from the inventory. I would think that this resource would not interfere with that.

2 Likes

It won’t. I use ox_inventory as well.

2 Likes

incredible, congratulations, extremely cool and fun

3 Likes

There is a file named -server.lua in the client folder and is being mounted as a client file, is this intentional?
image

Also, you mentioned you added a command to refresh the config, what is the name of that command?

1 Like

That file is correct that it is there, command is “vending_refreshConfig” and for “mxc_vend_prop_svapo_01” the size is the same of “prop_vend_snak_01”

2 Likes