Paid scripts
Poggy Trash Bins
Players rummage through town trash bins for random loot, with a cooldown per bin so nobody can farm one. Every bin is also a small shared storage anyone can open, good for dead drops and stashes.
Overview#
Walk up to a trash bin and two prompts appear: search it, or look inside. A search plays an animation with a progress bar, then rolls the loot table. Each bin also has its own shared storage that any player can open, so bins double as dead drops and stash spots.
- Search and loot from one shared loot list, with a chance per item. Any bin can have its own list instead.
- Cooldowns: after a search a bin stays empty for a random 30 minutes to 2 hours.
- Shared storage in every bin.
- 33 ready-made bins across Valentine, Annesburg, Strawberry, Blackwater, Saint Denis, Tumbleweed, Armadillo and more.
- Bins already in the world can become searchable on their own, with no coordinates needed.
- Anti-exploit: no searching while another player stands too close, and the server checks distance and cooldown itself.
- Staff wipe command to empty every bin at once.
- Optional Discord log of what each player found, and optional map blips.
- Built-in progress bar: no other resource needed.
Requirements#
| What | Why |
|---|---|
| RedM with VORP Core, RSG Core or QBCore RedM | Loot and bin storage go through your framework's inventory (a custom inventory on VORP, a stash on RSG and QBCore RedM). |
| poggy_core 0.13.0 or newer | Every storage, item and group check goes through it. It must start first. |
No database tables of its own: bin contents are kept by your inventory through poggy_core.
Installation#
- Download
poggy_trashbinsfrom your Cfx portal and put the folder in your server'sresourcesfolder. - In
server.cfg, start it after poggy_core:ensure poggy_core ensure poggy_trashbins - Check that every item in the loot list exists on your server (see Configuration). The shipped list uses common VORP item names.
- Restart the server.
Configuration#
Every setting can be changed in game in the /poggy settings hub under Trash Bins, or by hand in config.lua and translations.lua. Restart the script after a change. The hub has two help pages: Adding bins and Tuning the loot.
Searching
| Setting | Default | What it does |
|---|---|---|
Cooldown: shortest (Config.RefillTimeMin) | 1800 s | After a search a bin stays empty for a random time between the shortest and longest cooldown. 1800 is 30 minutes. This happens even when nothing was found. |
Cooldown: longest (Config.RefillTimeMax) | 7200 s | The longest a searched bin stays empty. 7200 is 2 hours. |
Search time: shortest (Config.SearchTimeMin) | 5000 ms | A search takes a random time between the shortest and longest. |
Search time: longest (Config.SearchTimeMax) | 10000 ms | The longest a search takes. |
Most items per search (Config.MaxItemsPerSearch) | 2 | The most different items one search can find. If more are rolled, a random few are kept. 0 means searches always find nothing. |
Show progress bar (Config.UseScriptProgressbar) | true | Shows a bar while a player searches. The search takes the same time either way. |
Prompt distance (Config.InteractionRadius) | 1.5 m | How close a player must be to see the prompts. |
Personal space (Config.BlockTrashIfPlayerIsNearRange) | 3.0 m | A player cannot search while someone else stands this close. 0 turns the check off. |
Search key / Storage key (Config.SearchKey, Config.StorageKey) | 0x41AC83D1 / 0xFF8109D8 | Control hashes for the two prompts. They must differ. |
Loot (Config.CommonLoot)
Every bin draws from this one list. Each item has an item name, a label, a chance (percent, 1 to 100) and the fewest and most (minamount, maxamount).
{ item = "glassbottle", label = "Glass Bottle", chance = 40, minamount = 1, maxamount = 2 },
How a search works: each item is rolled on its own (chance 25 is found on one search in four), each item found gets a random amount between fewest and most, and if more than Most items per search were found a random few are kept.
The shipped list has bottles, paper, food and drink, cigarettes, beer, whisky, cloth, bandages and medicine. Weapons and ammunition are left out on purpose. A few extra example items are in the file, commented out: turn them on only if those items exist on your server.
Every item must exist in your server's items list, or that item is never given.
Bins (Config.TrashBins)
Your listed bins, 33 by default. Each has a position, whether to spawn a bin prop there (shouldSpawn; off when a bin already stands at that spot), a storage id, and its storage slots (storageitemlimit, 20 by default). To give one bin different loot, add a loot = { ... } list to it in the same shape as the shared list, or fill its Own loot tab in the hub.
To add one in game: stand on the spot, open /poggy → Trash Bins → Locations → Bins, press Add bin, use use my position, choose whether to spawn a bin there, and give it a storage id no other bin uses (the next number, such as 34).
Storage ids are data. Each bin's contents are saved under its storage id. Two bins with the same id share one storage, and changing an id loses whatever players left in that bin.
Bins already in the world
| Setting | Default | What it does |
|---|---|---|
Find world bins (Config.AutoDetect) | true | Bins that already stand in the game world become searchable as players come near them. Each gets its own storage, named from its position. |
Bin models to find (Config.AutoDetectModels) | p_streettrashcannbx01x, p_trashbin01x, p_trashbin01bx | The object models that count as a trash bin. Remove one to stop it counting. |
Rescan every (Config.AutoDetectRescanInterval) | 15 s | How often each player's game looks for world bins nearby. |
Storage slots (Config.AutoDetectDefaults.storageitemlimit) | 20 | Slots in each found bin's storage. |
Found bins use the shared loot and never get a map blip.
Storage, staff and logging
| Setting | Default | What it does |
|---|---|---|
Empty bins on restart (Config.WipeStorageOnScriptStart) | true | Every bin's storage is emptied each time the script or server starts. Turn off to keep what players leave in bins across restarts. |
Allow weapons in bins (Config.AllowWeaponsInStorages) | false | Lets players put weapons in bin storage. Not recommended: bins are open to everyone. |
Staff wipe command (Config.AllowStaffGroupsToWipeWithCommand) | true | When off, the wipe command is not registered at all. |
Wipe command name (Config.WipeCommand) | "emptytrash" | The command that empties every bin, without the slash. |
Staff groups (Config.StaffGroups) | superadmin, admin, moderator | Character groups that may use the wipe command. Not case-sensitive. |
Map blips (Config.EnableBlips) | false | Shows every listed bin on the map. |
Blip icon (Config.SetBlipSprite) | 1109348405 | The blip sprite hash. |
Discord logging (Config.EnableLogs) | false | Posts every successful search, with who found what, to Discord. |
Webhook URL (Config.LogsWebhook) | placeholder | The Discord webhook to post to. Nothing is sent while it is still the placeholder. |
Text
Every message players see is in translations.lua (in the hub: Text & language). Only English ships; to add a language, copy the en block, give it a new name and set Config.Language to it. Keep colour codes such as ~t6~, ~t8~ and ~d~ in place.
Commands#
| Command | Who | What it does |
|---|---|---|
/emptytrash | Staff groups, server console | Empties every bin's storage and resets their search cooldowns. |
The name is set by Config.WipeCommand. It only exists while Staff wipe command is on.
Permissions#
Searching and opening bins need no permission.
The wipe command checks the character's group, as poggy_core reports it, against Staff groups (superadmin, admin and moderator by default). It is not an ACE permission. The server console can always run it.
Using it in game#
- Walk up to a bin. Two prompts appear: Search the Trash Bin and Take a look inside the Trash Bin.
- Search: your character rummages for 5 to 10 seconds, then finds up to 2 items, or nothing.
- The bin is then empty for 30 minutes to 2 hours. Searching it again too soon says someone has already been through it.
- Look inside: opens the bin's shared storage. Anything you leave can be taken by anyone, and is emptied at the next restart unless the owner turned that off.
Troubleshooting#
Searching never finds anything
Check that the loot items exist in your items list, and that Most items per search is above 0. A full inventory also means nothing is given.
"Someone is standing too close to you!"
Another player is within Personal space (3 metres by default) of the bin.
"It looks like someone has already messed around here."
The bin is on cooldown. Wait, or lower the cooldowns.
Things left in bins disappear after a restart
That is Empty bins on restart. Turn it off to keep bin contents across restarts.
The wipe command does nothing
Check that your character's group is in Staff groups and that Staff wipe command is on (the script must be restarted after turning it on).
Two bins share the same contents
They have the same storage id. Give each listed bin its own.
Updating#
poggy_core's updater keeps it up to date, and your config.lua and translations.lua settings are kept: see Updates.
From 1.5.2 a bin no longer needs loot = Config.CommonLoot: a bin without its own loot uses the shared list. Older configs that still have the line work as before.