
Initializing
Secure Protocol Active
Was this page helpful?
When MBT.UseTarget is set to false, players interact using the keyboard:
| Key | Action |
|---|---|
E | Open the vending machine NUI (when within MBT.HintDistance) |
The key is registered via RegisterKeyMapping as drinkMachineInteract. It is hidden from the chat suggestion list automatically.
When MBT.UseTarget is true, no command is needed — interaction is handled entirely by ox_target or qb-target on the prop model.
When a player looks at a deployed machine via ox_target:
| Option | Description |
|---|---|
| Move | Enter placement mode to reposition the machine |
| Repack Kit | Remove all props and return the vendingmachine item to inventory |
| Key | Action |
|---|---|
↑ ↓ ← → | Move horizontally |
Q | Raise |
Z | Lower |
Numpad 9 | Rotate left |
Numpad 7 | Rotate right |
|
Move mode exits if you walk more than MBT.MaxDistanceMove units from the machine.
E key)checkPrice to the servernot_enough_money notificationtoo_heavy notification| Event | Description |
|---|---|
mbt_drink_machine:openMalidrink | Opens the NUI. Triggered by target interaction or proximity key. |
mbt_drink_machine:createMachine | Spawns the deployable vending machine prop near the player. |
mbt_drink_machine:moveEntity | Enters move/placement mode for a given prop entity. |
mbt_drink_machine:deleteKit | Repacks the deployed machine and returns the item. |
mbt_drink_machine:setupTarget |
| Event | Target | Description |
|---|---|---|
mbt_drink_machine:startInteraction | buyer | Payment accepted — triggers the NUI grab sequence. |
mbt_drink_machine:takeDrinkAnim | buyer | Plays the arm-grab animation (mp_common / givetake1_a). |
mbt_drink_machine:syncTarget | all (-1) | Broadcasts deployed machine network IDs so all players can register target interactions. |
| Event | Payload | Description |
|---|---|---|
mbt_drink_machine:tryInteraction | drink (string) | Check player balance and inventory before purchase. |
mbt_drink_machine:takeDrink | drink (string) | Finalise purchase — give item to player. |
mbt_drink_machine:requestSyncTarget | { drinkMachine: netId } |
| Callback | Payload | Description |
|---|---|---|
checkPrice | { drink } | Fired when the player selects a drink in the NUI. Triggers server-side balance check. |
takeDrink | { drink } | Fired when the player confirms the purchase. Closes NUI and triggers item grant. |
closeUI | — | Fired when the player closes the NUI without purchasing. |
| Confirm position |
| Initialises ox_target / qb-target on machine props. Fired at resource start. |
| Sent after deploying the machine; server broadcasts to all clients. |
mbt_drink_machine:deleteObjects | { drinkMachine: netId } | Deletes the deployed machine server-side and returns the item. |