I see sometimes OnPlayerDie is called when NPC dies. That's incorrect. Please, fix that.
Solved OnPlayerDie being called for NPCs (NPCs are players)
Discussion in 'Rust Development' started by Iv Misticos, Aug 6, 2018.
-
The NPC is classed as a player.
-
I think that it's stupid to call OnPLAYERDie when Scientist\.. dies. Add OnNPCDie if Wolf\.. want -
That'd mean 2 hook calls for the exact same behaviour which is incredibly inefficient.
If you don't want the NPCs to trigger your hook call then add a simple if check above your code such as
Code:If (player is NPCPlayerApex) { return; }
-
-
-
-
-
-
Another solution is also checking against the userid.
Code:if (player.userID < 70000000000) return;