Return the entity number of the NPC "paper-1" (config.lua or generated by event like "boss-1")
If the function returns 0, it means that the player has not generated the NPC because they are too far away.
Example :
Citizen.CreateThread(function()
while true do
Citizen.Wait(100)
local botNPC = exports.bt_publicnpc:getNPCEntity("paper-1")
if DoesEntityExist(botNPC) then
if #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(botNPC)) < 5.0 then
SetPedScale(botNPC, 2.0)
else
SetPedScale(botNPC, 1.0)
end
end
end
end)
Here is an excerpt from the config.lua file : (parts of the excerpt are hidden)
-- model : model name of the NPC
-- coords : x y z location
-- heading : the direction or orientation that the NPC is facing or looking towards
-- anim : scenario (hidden link)
-- distance : The distance from which the NPC will be loaded.
-- dontreact : The NPC ignores everything that is happening around him.
-- walking : The NPC will walk around
-- walking distance : The distance to walk around
-- weapon : Give a Weapon to the NPC.
Config.PNJ = {
["paper-1"] = { -- PAPERBOY
model = "S_M_Y_NewspaperBoy_01",
coords = { x = -793.6 , y = -1292.98 , z = 42.63 },
heading = 79.56,
anim = "WORLD_HUMAN_SIT_GROUND_READ_NEWSPAPER",
distance = 50.0,
dontreact = true,
walking = true,
walking_distance = 10.0,
weapon = ""
},
-- this content is hidden in the excerpt
}