Hello excuse me ! I need help to make a script where during gunshots ped that are around don’t flee and the peds who are attacking with melee weapon doesn’t stop from attacking even if somebody has a gun, i found a lot of tasks to make that but I need help to make that work in a script ! Thank you very much !
I found an attribute that makes them attack no matter what and a script that stops them from fleeing when you pull a weapon out
local peds = GetAllPeds()
for i=1, #peds, 1 do
local distance = #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(peds[i]))
if distance < 50 and peds[i] ~= PlayerPedId() then
TaskSetBlockingOfNonTemporaryEvents(peds[i], true)
end
end
or something like that
what I did here is checking for all peds on server nearby player by 50 GTA units
and executed the native on them that should work try that!