From 9463039271b61990b59ea8aa299c2d4b48dade04 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 31 Jan 2022 12:32:29 -0600 Subject: [PATCH] NPCData is supposed to accept ped, not int --- scripts/server/npc.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/server/npc.js b/scripts/server/npc.js index 745e5930..f79503b4 100644 --- a/scripts/server/npc.js +++ b/scripts/server/npc.js @@ -17,11 +17,14 @@ function initNPCScript() { // =========================================================================== /** - * @param {number} npcId - The data index of the NPC + * @param {Ped} ped - The data index of the NPC * @return {NPCData} The NPC's data (class instancee) */ -function getNPCData(npcId) { - return ped.getData("vrr.dataIndex"); +function getNPCData(ped) { + if(ped.getData("vrr.dataIndex")) { + return ped.getData("vrr.dataIndex"); + } + return false; } // ===========================================================================