Kartik Scripts

Trashbin

To prevent citizens or visitors from triggering metal detector gates or getting caught with prohibited items in restricted areas, you can configure physical trash spots (Security Trash Bins) directly outside checkpoints or lobby entryways.


How It Works

  • Physical Props: A trash bin prop (e.g. prop_bin_01a) is spawned at the configured coordinates.
  • Target Interaction: Citizens can use target interaction (such as ox_target or qb-target) to interact with the bin and select Open Trash Bin.
  • Pocket Disposal: This opens a public stash where players can dump weapons, blade attachments, and pocket contraband before passing through checkpoint scanners.
  • Auto-Deletion on Close: The bin functions as a real trash can. By default, when a player closes the bin inventory, all items placed inside are automatically deleted/wiped.
  • Optional Persistence: If AutoDelete is set to false, items placed inside the trash bins will instead be saved and remain inside the stashes across server restarts.

Configuration

The feature config settings are stored in shared/config_trashbin.lua:

Config.TrashBins = {
    Prop = 'prop_bin_01a', -- Model of trash bin prop (set to false or nil to use zones without props)
    AutoDelete = true,     -- Automatically delete items placed in the bin when the stash is closed (real trash bin behavior)
    Bins = {
        {
            coords = vec3(441.5, -973.8, 30.69), -- Coordinates near the Mission Row front entry
            heading = 90.0,
            label = "Security Trash Bin",
            slots = 30,
            weight = 100000, -- 100kg capacity
            spawnProp = true,
        }
    }
}

On this page