mikou
September 24, 2019, 1:46am
3
Hi, i use this in a customized pet script and it work fine for me, the dog attack the ped that the player is aiming at but you need to add a function to detect which ped the player is aiming at.
https://runtime.fivem.net/doc/natives/#_0xF166E48407BAC484
The same kind of aiming detection i’m using:
I am trying to make it where if a player aims a gun at a ped certain things happen. This is what i have so far and not working. this is in LUA
anyone able to help?
ESX = nil
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
end)
Citizen.CreateThread(function() -- Creates thread
while true do
Citizen.Wait(1)
local aiming, targetPed = GetEntityPlayerIsFreeAimingAt(PlayerId(-1))
if aiming then…