This script allows you to search any dumpster in the game/city, with cooldown limits on searching the same dumpster twice. Finally you can be the tramp you’ve always wanted to be.
Features:
Search any dumpster in the city
Specific dumpsters have a cooldown timer after you search it (5 minutes default)
Get random items from dumpsters based on chance.
Ability to add a limit to the amount of items you can hold from dumpsters
Resource is abandoned and is no longer being worked on, this is one of my very early resources and is not optimized at all. I do not recommend using this unless you’re willing to optimize it yourself, it doesn’t take a lot of work regardless.
Hey man, would you be kind enough to share that hud you have please? Jamie.#1913 Just in cade you would like too Awesome script definitely going to use this!
Yeah I understand, like I said I prefer to make my own scripts, if I have an idea for something I’m going to make it rather than google for a script. My smaller-scale scripts I make I release on the forums, and just because someone might have a similar script that wouldn’t be a reason for me to not release it also. But thanks.
You converted this just to advertise a script selling store on your github repo, I don’t mind you converting my scripts to vRP but do the decent thing and stop breaking FiveM TOS while you’re at it.
Great release! Thank you. Only thing I would change is to add a sleep in the main thread as to not run so high when you are not by a dumpster. This is all I did:
Citizen.CreateThread(function()
while true do
sleep = 500
if canSearch then
local ped = GetPlayerPed(-1)
local pos = GetEntityCoords(ped)
local dumpsterFound = false
for i = 1, #dumpsters do
local dumpster = GetClosestObjectOfType(pos.x, pos.y, pos.z, 1.0, dumpsters[i], false, false, false)
local dumpPos = GetEntityCoords(dumpster)
local dist = GetDistanceBetweenCoords(pos.x, pos.y, pos.z, dumpPos.x, dumpPos.y, dumpPos.z, true)
if dist < 1.8 then
sleep = 5
DrawText3Ds(dumpPos.x, dumpPos.y, dumpPos.z + 1.0, 'Flex [~y~H~w~] to dumpster dive')
if IsControlJustReleased(0, 74) then
for i = 1, #searched do
if searched[i] == dumpster then
dumpsterFound = true
end
if i == #searched and dumpsterFound then
exports['mythic_notify']:DoHudText('error', 'You already searched this dumpster')
elseif i == #searched and not dumpsterFound then
startSearching(searchTime, 'amb@prop_human_bum_bin@base', 'base', 'onyx:giveDumpsterReward')
TriggerServerEvent('onyx:startDumpsterTimer', dumpster)
table.insert(searched, dumpster)
end
end
end
end
end
end
Citizen.Wait(sleep)
end
end)
``` Hope this helps
So much better then other similar resources I’ve seen!
However, It’d be cool if it checked how much of an item you have in your inventory before you’re allowed to search it or just not give you any more if => a number. I tried to write it myself but failed miserably
Updated the script to allow for limiting the amount of items you get from dumpster diving as requested by @Shelby_Moon. To allowed for unlimited amounts of an item just change the value to 0.
[1] = {chance = 2, id = 'glassbottle', name = 'Glass Bottle', quantity = math.random(1,3), limit = 10}, -- max 10
[5] = {chance = 3, id = 'plastic', name = 'Plastic', quantity = math.random(1,8), limit = 0}, -- unlimited