[Release][ESX] Rob NPCs

This is as simple as it reads, all you got to do is download the script, place it into your resources folder and add it to your server.cfg file by writing start esx_robnpc anywhere you find.

Download: https://github.com/D3uxx/esx_robnpc
VRP Version: https://forum.cfx.re/uploads/default/original/3X/c/5/c51b12236fca06efd9542c5ee69eda8044d1b8ed.rar thanks to https://forum.cfx.re/u/TerbSEC

Get close to a ped, aim at him and press E, it will give you money.

The script was written in around 20 minutes so don’t expect it to be very sophisticated as of now.

14 Likes

will police get notification? if so then this is an awesome script

I still need to add that, I think I will need to integrate it with outlaw script.

hmmmmmm?


1+

dame nice script dude thank you

should also probably change the coding to reflect that this money would be black money as well, but that’s just a thought on my teams end

1 Like

VRP :))
vrp_robnpc.rar (17.2 KB)
I’ve have added so your freezetime is not 10 Seconds, it looks dum when the NPC hold hear hands up for 10 Seconds and running with hear legs, but cant go anywhere, because the Entity is Freezed.
So its changed to 1 :slight_smile:

+1 for an nice Script @hypr9xa

This is really a simple Script thanks for sharing and for the ideađź‘Ś

Nice job, that was fast.

I’ll add it to OP and credit you!

1 Like

That a Nice release man…
Keep it up


:man_dancing:

Take a look at the stasiek selldrugs script. It works well with esx police interaction. The dealer only knows that his advances were refused and the NPC randomly notifies police. It works really well actually.

I put the esx Rob NPCs
I have Npc rendered, but checked in my portfolio and I do not receive $,
Is there anything else for him to repay me in addition to aim and squeeze and to render him?

Perhaps some GTA Natives could do that, something like what GTA Online had with stores.

If you added notifications that sent to the police officers then can you please add a limitation? I mean, you can rob the people only if there are 3 police officers on the server or can you add a limitation that you can rob again after maybe 300 seconds?

I’d love to see this updated! Great concept.

1 Like

Any update on this with sending a notification to the police when robbing an NPC?

2 Likes

Just implamented on a server, I was able to rob a player using this system, do you know if there’s anything in the code that I can change so players can’t be robbed too?

Thanks for the mod, works great for NPC’s :slight_smile:

Not sure if this will help someone or not and I am not really good at coding but here is some fixes that will make them sit in place while your rob them and not run in place like before:

function robNpc(targetPed)
    robbedRecently = true

    Citizen.CreateThread(function()
        local dict = 'mp_am_hold_up'
        RequestAnimDict(dict)
        while not HasAnimDictLoaded(dict) do
            Citizen.Wait(10)
        end

        SetEveryoneIgnorePlayer(PlayerId(), true)
        TaskStandStill(targetPed, Config.RobAnimationSeconds * 1000)
        --FreezeEntityPosition(targetPed, true)
        SetBlockingOfNonTemporaryEvents(targetPed, true)
        TaskPlayAnim(targetPed, dict, 'cower_loop', 8.0, -8, 15000.0, 49, 0, 0, 0, 0)
        FreezeEntityPosition(targetPed, true)
        robbed = true
        ESX.ShowNotification(_U('robbery_started'))

        Citizen.Wait(Config.RobAnimationSeconds * 1000)

        ESX.TriggerServerCallback('esx_robnpc:giveMoney', function(amount)
            FreezeEntityPosition(targetPed, false)
            ESX.ShowNotification(_U('robbery_completed', amount))
        end)

        if Config.ShouldWaitBetweenRobbing then
            Citizen.Wait(math.random(Config.MinWaitSeconds, Config.MaxWaitSeconds) * 1000)
            ESX.ShowNotification(_U('can_rob_again'))
        end

        robbedRecently = false
    end)
end
1 Like

Any Updated on Cops Getting Notified ?

I created a scripted based off of this that uses the TaskHandUp that keeps them standing in one place without having to freeze the entity.