Check out My Vending Machine Script with a Robbery Feature! 
Hey everyone! I’ve cooked up this script for my server. It adds some cool interactive vending machines for drinks and snacks, and get this – you can even try to rob them!
What My Script Can Do:
- Buying Goodies
: Players can grab items from the machines like usual.
- Pay with cash or from their bank account.
- Choose how many they want.
- There’s a neat animation when they buy.
- Pay with cash or from their bank account.
- Vending Machine Heists!
:
- You can decide which machines can be robbed in the settings – super flexible!
- Thieves will need a specific item (like a “lockpick” – you can set this in the config).
- When they try to rob it, a minigame pops up (it’s a skill check from
ox_lib
). - If they nail the minigame, they get a random amount of cash (you set the min/max in the config).
- After a successful score, that machine goes on a cooldown so it can’t be hit again right away.
- Easy Configuration
:
- Translations: All the text players see (notifications, labels, etc.) can be easily translated. Just edit
Config.Translations
! - Machine Setup:
- Adding new machines is a breeze using their model name or hash.
- Set up what each machine sells, the prices, and labels.
- Fine-tune the robbery settings for every single machine:
enableRobbery
(true/false)robberyItemNeeded
(what item they need)robberyMoneyMin
/robberyMoneyMax
(how much they can get)robberyCooldownMinutes
(how long till it can be robbed again)
- Animations: You can even define animations for buying and robbing if you want!
- Translations: All the text players see (notifications, labels, etc.) can be easily translated. Just edit
- Works with
ox_target
&ox_lib
:- I’m using
ox_target
for the interaction with the machines. - And
ox_lib
handles the cool dialogues and the skill check minigame.
- I’m using
- Security First!
:
- Don’t worry, the server checks all the important stuff (item prices, if players actually have the items needed for robbing, cooldowns) to keep cheaters out.
What You’ll Need:
- ESX Framework (I tested it with es_extended, should be fine!)
ox_lib
(for those sweet dialogues and the skill check)ox_target
(for making the machines interactive)
Code is accessible | Yes |
Subscription-based | No |
Lines (approximately) | 250 |
Requirements | ESX, OxLib, OxTarget |
Support | No |