I was looking into that situation as the server I play on we have stationary NPC as well for doctors we do not want people to be able to mug. I am looking at having it check the entity to see if it is a MissionEntity before the mugging and if it is have it ignore the mugging.
Hopefully this will be in the next release i hope to have out tonight and will solve your issue.
Was able to get a quick update out that will now have any MissionEntity NPC ignore the script completly. If they are suppost to just stand there… that is what they will do. Hope this works for your server same as i did on my test server.
i havent been able to check this out… but do the NPC’s stick their hands up and is it synced between all players? and then does the NPC put their hands down and run after the robbery? the ROBNPC script i use the NPC’s never put their hands down. The other players cannot see it, and you can rob normal players but the server treats it like an NPC… so you dont actually take another players personal money… and your PED only has hands up on the side of the person doing the robbery.
The testing I did on the server i play on you will see if someone else is mugging a NPC (hands up).
As for after robbery - i have spent a fair bit of time tying to get them to 100% run after mugging… but seems like the first npc you mug has a chance of getting frozen with hands up for a few seconds and then walks off… but the rest the NPC should get scared and run off if you are still aiming at them after the mugging.
As for other Mugging other players - this script checks to see if you are aiming at a player and if you are it ignores the mugging part of the script - so no mugging other players.
Its not 100% notifcation rate for police… do you have esx_jobs and esx_policejob on your server. It will notify anyone that has ESX.PlayerData.job.name == ‘police’ in the form of a ESX.ShowAdvancedNotification so not sure why you wouldn’t get a notification if you have job set to police and a alert was sent out.
If you want to pm me your server i can help test it.
Sorry for not putting the credit and link to your post on here… it is on the github ReadMe so anyone that downloads will see that this is based off your orginal script. But i will put it on here as well.
I was trying to fix the - not noticing when change of job after login… and put the request to get job name inside of a loop where it shouldn’t have been. So was requesting job name every tick which was a huge issue
I did add the check for MisionEntity for NPC to not allow robbing of static npc’s on server like the store clerks or doctors some servers have stationed around the city. So any ped that are marked as a mission entity will just ignore the script.