Hello again. I was able to solve your issue. I don’t code in lua and thats why my script is in javascript. This code is running fine and the dog is attacking the player:
RegisterCommand("test", async (source, args, rawCommand)=>{
let dogModel = 882848737
let player = GetPlayerPed(-1)
let loc = GetEntityCoords(player, true)
let [pX, pY, pZ] = loc
RequestModel(dogModel)
let wait = 0
while(!HasModelLoaded(dogModel)){
wait = wait + 100
await rpme.functions.sleep(10);
if(wait > 10000){
return
}
}
let dogPed = CreatePed(5, dogModel, pX, pY, pZ, 0, true, false)
ClearPedTasks(dogPed)
SetPedAsEnemy(dogPed, true)
TaskCombatPed(dogPed, player)
})
If you need help to translate it in lua just tell me.
PS: The only problem is when the player enters a car, the dog doesn’t follow or attack him even after he exits the car