[Release] K9 SCRIPT [WORKING] [UPDATED]

So when I try to attack someone the dog starts attacking me

I believe it is something in the script about target player…which is not targeting the player…i think its something with GetPlayerId

Yeah, when I point at a player the K9 just attacks me, anyway to fix this?

Does anyone know script work…

if IsControlJustPressed(1, 288) and IsPlayerFreeAiming(PlayerId()) then
local bool, target = GetEntityPlayerIsFreeAimingAt(PlayerId())

            if bool then
                if IsEntityAPed(target) then
                    TriggerEvent("K9:ToggleAttack", target)
                end
            end
        end

Im guessing it has something to do with playerid

Mine is just F11