[ESX] Onyx Dumpster Diving

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

Optional Scripts that go along with it:

  • ProgressBars
  • MythicNotify
  • ESX

Media:




4

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.

Download:
ESX: GitHub

17 Likes

Great one, thanks

1 Like

Hey man, would you be kind enough to share that hud you have please? Jamie.#1913 Just in cade you would like too :slight_smile: Awesome script definitely going to use this!

1 Like

bruh…
i thought jumping in to dumpster :smiley:

2 Likes

This script has already been done.

Id of focused of creating stuff thats not been done yet.

The other one is exactly the same as this lol

Never seen it before like to make my own scripts, but go download that one then :slight_smile:

2 Likes

Simple research/googling would’ve shown that though. Either way, this is much better than the other one that is out there! So good job

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.

2 Likes

I converted this to vrp 0.5.
You can download it from this link.
Download

1 Like

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.

EDIT: Thanks for removing the discord link

3 Likes

Neat script, going to check it out.

Off-topic: why do ya’ll always copy NoPixel’s HUD instead of going for something unique and different?

Awesome script. I like your version better then the other ones out there. Nicely done!

1 Like

because its unique and looks decent compared to others

1 Like

0.89ms is that right ? ha…

[ESX] Search dumpsters Now you have seen it. Your code is different tho, so not saying you coppied anything. Just letting you know it exist.

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
1 Like

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 :stuck_out_tongue:

1 Like

@Shelby_Moon yeah that could be implemented, if they have too much of one item it could just reroll good idea.

@Geerdodagr8 yeah, to be fair I rushed this and completely forgot. Thanks that will improve performance.

1 Like

Nice script

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
1 Like