leihebi Posted February 14, 2021 Share Posted February 14, 2021 As the title suggests, when the player attacks the npc, the npc then reacts Link to comment Share on other sites More sharing options...
LeeC22 Posted February 14, 2021 Share Posted February 14, 2021 9 minutes ago, leihebi said: As the title suggests, when the player attacks the npc, the npc then reacts The game already does this, if you attack an NPC they will react. I don't understand what you are trying to detect, explain more about the situation and the information you are trying to get back about that situation... one line of text tells us very little. Link to comment Share on other sites More sharing options...
leihebi Posted February 14, 2021 Author Share Posted February 14, 2021 1 hour ago, LeeC22 said: The game already does this, if you attack an NPC they will react. I don't understand what you are trying to detect, explain more about the situation and the information you are trying to get back about that situation... one line of text tells us very little. It's like this, when the player is a certain value away from the generated ped he can say 10f~300f Link to comment Share on other sites More sharing options...
LeeC22 Posted February 14, 2021 Share Posted February 14, 2021 1 minute ago, leihebi said: It's like this, when the player is a certain value away from the generated ped he can say 10f~300f World.GetDistance(Game.Player.Character.Position, NPC.Position); leihebi 1 Link to comment Share on other sites More sharing options...
leihebi Posted February 14, 2021 Author Share Posted February 14, 2021 3 hours ago, LeeC22 said: World.GetDistance(Game.Player.Character.Position, NPC.Position); Brother, do you know how to make npc's not attack each other?Function.Call(Hash.SET_CAN_ATTACK_FRIENDLY, npc1, false, npc2, false); doesn't seem to work Link to comment Share on other sites More sharing options...
leihebi Posted February 14, 2021 Author Share Posted February 14, 2021 3 hours ago, LeeC22 said: World.GetDistance(Game.Player.Character.Position, NPC.Position); Thanks, it works fine, but it seems that players attack when they are far away from the npc. There is a way to get the player closer to the npc before attacking the player Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now