Attacking at distance not workingFixed
first i set the to =  "damageDistance": 20.0, but it dont works , then i used "damageDistance": 200.0, not working too he shots only in meele range on me  , but before he make it he  shot 1 times on a higher distance.. pls help me :(
{
"HumanNPCs": [
{
"userid": 1078225584,
"displayName": "[Bot]Airfield-Guard",
"invulnerability": false,
"health": 200.0,
"respawn": true,
"respawnSeconds": 1200.0,
"spawnInfo": {
"position": "152.2645 14.7375 1310.225",
"rotation": "0.03608368 0.6995547 -0.03541376 0.7127882"
},
"waypoint": null,
"collisionRadius": 20.0,
"spawnkit": "npcp2",
"damageAmount": 15.0,
"damageDistance": 200.0,
"damageInterval": 0.7,
"attackDistance": 70.0,
"maxDistance": 150.0,
"minstrel": null,
"hostile": true,
"speed": 6.0,
"stopandtalk": true,
"stopandtalkSeconds": 3.0,
"enable": true,
"lootable": true,
"hitchance": 0.7,
"reloadDuration": 3.0,
"needsAmmo": false,
"defend": true,
"message_hello": null,
"message_bye": null,
"message_use": null,
"message_hurt": null,
"message_kill": null,
"protections": {
"Generic": 0.0,
"Hunger": 0.0,
"Thirst": 0.0,
"Cold": 0.0,
"Drowned": 0.0,
"Heat": 0.0,
"Bleeding": 0.0,
"Poison": 0.0,
"Suicide": 0.0,
"Bullet": 0.0,
"Slash": 0.0,
"Blunt": 0.0,
"Fall": 0.0,
"Radiation": 0.0,
"Bite": 0.0,
"Stab": 0.0,
"Explosion": 0.0,
"RadiationExposure": 0.0,
"ColdExposure": 0.0,
"Decay": 0.0,
"ElectricShock": 0.0,
"Arrow": 0.0
}
}
]
}​
In response to AgentXTopSecret ():
first i set the to =  "damageDistance": 20.0, but it dont works , then i used "damageDistance": 200....

The issue is, they can't use guns as ranged weapons. It has to be point blank...for some reason. If you want them to use ranged, it must be a bow or crossbow. 

 

I'm looking for a solution myself. 

Found any solution for that? It would be nice to have snipers npc but with a bow or crossbow that would be.... Disappointing a bit...
I spent some time trying to get it to work to no end.  Others have had more success but sadly have not offered their code modifications to the community.  Perhaps when I have more time I can get it.

Merged post

This should be working now.  It still needs improvement.  But, the check being used to find the player before being right in their face was not working before.  So, they will attack once in range, and run as fast as you specify to get to you, etc.  If still in the max range, they will follow.
Locked automatically