Installation

2 min readUpdated Yesterday

Overview

ML Recycler is a placeable salvage machine. Players carry a recycler item, drop the prop in the world, and operate it through a screen rendered on the machine itself. Items are inserted into processing slots, break down over a timer into configurable outputs, and are collected from the same screen. The machine runs on optional fuel, wears down with use, and accepts upgrade modules. Server owners can also pin permanent community stations to the map.

Quick Start

  1. Download from CFX Portal
  2. Extract to your resources folder as ml_recycler
  3. Add to server.cfg:
server.cfg
1ensure oxmysql
2ensure ox_lib
3ensure ml_bridge
4ensure ml_recycler
Load Order

ml_recycler must start AFTER ml_bridge. Start xsound before it if you use the ambient sound.

Database

Tables are created automatically on first start. No manual SQL import is needed.

  • ml_recyclers: position, owner, type, fuel, durability, upgrades, upgrade wear and fixed station id
  • ml_recycler_slots: state of each slot (item, count, depositor, metadata, status, timestamps)
  • ml_recycler_config: values changed from the staff panel
  • ml_recycler_inventory_receipts: receipts that let an interrupted item transfer be refunded

On an older install the player_id column is added at start. ml_recycler.sql holds the same schema.

Item Registration

Register the items from _INSTALL/items.lua in your inventory, and copy the PNGs from _INSTALL/images/ into your inventory's image folder.

  • recycler: Placeable recycler
  • turbo_motor, extra_tank, silencer_kit, solar_panel: Upgrade modules

_INSTALL/items.lua ships the recycler and the four upgrades. Create the repair items of Config.RepairItems (repair_kit, patch_kit, lubricant), the fuel items of Config.Fuel (fuel_canister, industrial_battery), and every recyclable input and output item in your inventory. Item names are configurable in Config.Recycler, Config.Upgrades, Config.RepairItems and Config.Fuel.

Verify

After starting, the console prints the banner and a line like:

lua
1[ml_recycler] Resource started

Give yourself a recycler item and use it to enter placement mode.

  • Recycler not placing: Check Config.PlacementDistance, and that the recycler item is registered in your inventory.
  • Processing not starting: Check fuel level and Config.Features.fuelSystem. An empty tank pauses processing.
  • Sound not playing: Verify xsound is running and Config.Features.ambientSounds = true.
  • Screen not rendering: Check the F8 console for errors and verify Config.DuiResolution.
  • Insert/collect does nothing: Confirm the input item has a matching entry in Config.RecycleRecipes.