[OLD] [Release] NPCLife v1.0.0 - Put life into your stores

hi, how can i disable the blips please ?

1 Like

delete this:

-- Blip For NPC
Citizen.CreateThread(function()
	for k,v in pairs(ShopClerk)do
		local blip = AddBlipForCoord(v.x, v.y, v.z)
		SetBlipSprite(blip, v.BlipID)
		SetBlipScale(blip, 0.8)
		SetBlipAsShortRange(blip, true)
		BeginTextCommandSetBlipName("STRING")
		AddTextComponentString(v.name)
		EndTextCommandSetBlipName(blip)
	end
end)

what do you mean by ā€œcompleted file to shareā€ ?

@h0ldhaven Every NPC speak actually with all my test, but all girls speak with men voice for saying GENERIC HI or whatever.
Only s_m_y_devinsec_01 is dancing with the modification.
Donā€™t forget to add this piece of code :

dancing

for i=1, #ShopClerk do
distance = GetDistanceBetweenCoords(ShopClerk[i].x, ShopClerk[i].y, ShopClerk[i].z, GetEntityCoords(GetPlayerPed(-1)))
if distance < 4 and PlayingAnim ~= true then
TaskPlayAnim(ShopClerk[i].id,ā€œmini@strip_club@pole_dance@pole_a_2_stageā€,"_greeting", 1.0, -1.0, 4000, 0, 1, true, true, true)
PlayAmbientSpeech1(ShopClerk[i].id, ShopClerk[i].VoiceName, ā€œSPEECH_PARAMS_FORCEā€, 1)
PlayingAnim = true
Citizen.Wait(4000)
if PlayingAnim == true then
TaskPlayAnim(ShopClerk[i].id,ā€œmini@strip_club@pole_dance@pole_a_2_stageā€,"_idle_b", 1.0, -1.0, -1, 0, 1, true, true, true)
Citizen.Wait(40000)
end
elsefor i=1, #ShopClerk do
distance = GetDistanceBetweenCoords(ShopClerk[i].x, ShopClerk[i].y, ShopClerk[i].z, GetEntityCoords(GetPlayerPed(-1)))
if distance < 4 and PlayingAnim ~= true then
TaskPlayAnim(ShopClerk[i].id,ā€œmini@strip_club@pole_dance@pole_a_2_stageā€,"_greeting", 1.0, -1.0, 4000, 0, 1, true, true, true)
PlayAmbientSpeech1(ShopClerk[i].id, ShopClerk[i].VoiceName, ā€œSPEECH_PARAMS_FORCEā€, 1)
PlayingAnim = true
Citizen.Wait(4000)
if PlayingAnim == true then
TaskPlayAnim(ShopClerk[i].id,ā€œmini@strip_club@pole_dance@pole_a_2_stageā€,"_idle_b", 1.0, -1.0, -1, 0, 1, true, true, true)
Citizen.Wait(40000)
end
else

1 Like

A file with all shops filled with NPCā€™s.

1 Like

Hi, you have a other link for animations list :confused: ?

1 Like

How you can find ambiance in this list ? http://docs.ragepluginhook.net/html/62951c37-a440-478c-b389-c471230ddfc5.htm

I canā€™t find ā€œammucityā€ in this list :confused:

--	{id = 02, name = "Shop", BlipID = 52, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = 24.392505645752, y = -1345.41369628906, z = 29.4970207214355, heading = 264.900115966797},
1 Like

this is not the ambience, it is the list of animation that your npc will do :slight_smile:
for the moment, I have not yet found a link with the list of ambiences.

strangeā€¦ normally the game automatically handles this. :confused:

for the moment it is necessary to do it yourself, itā€™s been a while since I did not come back on fivem, I would try to do it when I have a little more free time.

Yup that would be great, i actually tried one or two iterations but that fucked up the script.

1 Like

Thank you :slight_smile: , the NPC are all shooting at each other. The goal would be that they all be together to shoot me, for example :slight_smile:

Hi, you know how to put an object in their hand, instead of the weapon?

Hey first off awesome script man thanks for this. Secondly anybody figured out how to fix the ammucity ambiance animation? can I plug an animation loop into the ambiance area or no?

I have been working all npc shops including the strip club. I will upload my files when Iā€™m finished. I work on this daily for my server.

The hardest part is getting the girls lined up on the poles. Not sure if I can even pull it off. They do pole dance but having them sync to the pole is hard. Unless we can get exact coords of the stripper positions on the poles.

Here is my Barbers!

-------------------------------------------------------------------------------------------------
---------------------------------- DON'T EDIT THESES LINES --------------------------------------
-------------------------------------------------------------------------------------------------

local generalLoaded = false
local PlayingAnim = false

-------------------------------------------------------------------------------------------------
----------------------------------- YOU CAN EDIT THIS LINES -------------------------------------
-------------------------------------------------------------------------------------------------

local Barber = {
  -- ID: id of NPC | name: Name of Blip | BlipID: Icone of Blip | VoiceName: NPC Talk When near it | Ambiance: Ambiance of Shop | Weapon: Hash of Weapon | modelHash: Model | X: Position x | Y: Position Y | Z: Position Z | heading: Where Npc look
	  {id = 1, name = "Barber", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_m_fembarber", x =- 817.349, y = -184.541, z = 37.569, heading = 134.069},
      {id = 1, name = "Barber", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_m_fembarber", x = 134.749, y = -1708.106, z = 29.292, heading = 146.281},
      {id = 1, name = "Barber", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_m_fembarber", x = -1284.038, y = -1115.635, z = 6.990, heading = 85.177},
      {id = 1, name = "Barber", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_m_fembarber", x = 1930.855, y = 3728.141, z = 32.844, heading = 220.243},
      {id = 1, name = "Barber", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_m_fembarber", x = 1211.521, y = -470.704, z = 66.208, heading = 79.543},
      {id = 1, name = "Barber", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_m_fembarber", x = -30.804, y = -151.648, z = 57.077, heading = 349.238},
      {id = 1, name = "Barber", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_m_fembarber", x = -278.205, y = 6230.279, z = 31.696, heading = 49.216}
}

-------------------------------------------------------------------------------------------------
---------------------------------- DON'T EDIT THESES LINES --------------------------------------
-------------------------------------------------------------------------------------------------

-- Blip For NPC
Citizen.CreateThread(function()
	for k,v in pairs(Barber)do
		local blip = AddBlipForCoord(v.x, v.y, v.z)
		SetBlipSprite(blip, v.BlipID)
		SetBlipScale(blip, 0.8)
		SetBlipAsShortRange(blip, true)
		BeginTextCommandSetBlipName("STRING")
		AddTextComponentString(v.name)
		EndTextCommandSetBlipName(blip)
	end
end)

-------------------------------------------------------------------------------------------------
---------------------------------- DON'T EDIT THESES LINES --------------------------------------
-------------------------------------------------------------------------------------------------

-- Spawn NPC
Citizen.CreateThread(function()
  while true do
    Citizen.Wait(0)
	
	if (not generalLoaded) then
	  
	  for i=1, #Barber do
        RequestModel(GetHashKey(Barber[i].modelHash))
        while not HasModelLoaded(GetHashKey(Barber[i].modelHash)) do
          Wait(1)
        end
		
        Barber[i].id = CreatePed(2, Barber[i].modelHash, Barber[i].x, Barber[i].y, Barber[i].z, Barber[i].heading, true, true)
        SetPedFleeAttributes(Barber[i].id, 0, 0)
		SetAmbientVoiceName(Barber[i].id, Barber[i].Ambiance)
		SetPedDropsWeaponsWhenDead(Barber[i].id, false)
		SetPedDiesWhenInjured(Barber[i].id, false)
		GiveWeaponToPed(Barber[i].id, Barber[i].Weapon, 2800, false, true)
		
      end
      generalLoaded = true
		
    end
	
  end
end)

-------------------------------------------------------------------------------------------------
---------------------------------- DON'T EDIT THESES LINES --------------------------------------
-------------------------------------------------------------------------------------------------

-- Action when player Near NPC (or not)
Citizen.CreateThread(function()
  while true do
    Citizen.Wait(0)
		RequestAnimDict("random@shop_gunstore")
		while (not HasAnimDictLoaded("random@shop_gunstore")) do 
			Citizen.Wait(0) 
		end
		
		for i=1, #Barber do
			distance = GetDistanceBetweenCoords(Barber[i].x, Barber[i].y, Barber[i].z, GetEntityCoords(GetPlayerPed(-1)))
			if distance < 4 and PlayingAnim ~= true then
				TaskPlayAnim(Barber[i].id,"random@shop_gunstore","_greeting", 1.0, -1.0, 4000, 0, 1, true, true, true)
				PlayAmbientSpeech1(Barber[i].id, Barber[i].VoiceName, "SPEECH_PARAMS_FORCE", 1)
				PlayingAnim = true
				Citizen.Wait(4000)
				if PlayingAnim == true then
					TaskPlayAnim(Barber[i].id,"random@shop_gunstore","_idle_b", 1.0, -1.0, -1, 0, 1, true, true, true)
					Citizen.Wait(40000)
				end
			else
				--don't touch this
				--TaskPlayAnim(Barber[i].id,"random@shop_gunstore","_idle", 1.0, -1.0, -1, 0, 1, true, true, true)
			end
			if distance > 5.5 and distance < 6 then
				PlayingAnim = false
			end


		end
  end
end)
4 Likes

Clothes shops

-------------------------------------------------------------------------------------------------
---------------------------------- DON'T EDIT THESES LINES --------------------------------------
-------------------------------------------------------------------------------------------------

local generalLoaded = false
local PlayingAnim = false

-------------------------------------------------------------------------------------------------
----------------------------------- YOU CAN EDIT THIS LINES -------------------------------------
-------------------------------------------------------------------------------------------------

local Tailor = {
  -- ID: id of NPC | name: Name of Blip | BlipID: Icone of Blip | VoiceName: NPC Talk When near it | Ambiance: Ambiance of Shop | Weapon: Hash of Weapon | modelHash: Model | X: Position x | Y: Position Y | Z: Position Z | heading: Where Npc look 
	  {id = 2, name = "Tailor", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_y_shop_mid", x = 73.883, y = -1392.551, z = 29.376, heading = 258.693},
      {id = 2, name = "Tailor", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_y_shop_mid", x = -708.705, y = -152.150, z = 37.415, heading = 118.490},
      {id = 2, name = "Tailor", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_y_shop_mid", x = -164.849, y = -302.719, z = 39.733, heading = 249.119},
      {id = 2, name = "Tailor", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_y_shop_mid", x = 126.824, y = -224.512, z = 54.558, heading = 71.926},
      {id = 2, name = "Tailor", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_y_shop_mid", x = 427.069, y = -806.280, z = 29.491, heading = 84.203},
      {id = 2, name = "Tailor", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_y_shop_mid", x = -822.872 , y = -1072.162, z = 11.328, heading = 203.007},
      {id = 2, name = "Tailor", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_y_shop_mid", x = -1193.691, y = -766.863, z = 17.316, heading = 216.273},
      {id = 2, name = "Tailor", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_y_shop_mid", x = -1448.901, y = -238.138, z = 49.814, heading = 48.307},
      {id = 2, name = "Tailor", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_y_shop_mid", x = 5.809, y = 6511.428, z = 31.878 , heading = 40.329},
      {id = 2, name = "Tailor", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_y_shop_mid", x = 1695.387, y = 4823.019, z = 42.063, heading = 96.539},
      {id = 2, name = "Tailor", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_y_shop_mid", x = 613.015, y = 2762.577, z = 42.088, heading = 277.766},
      {id = 2, name = "Tailor", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_y_shop_mid", x = 1196.435, y = 2711.634, z = 38.223, heading = 179.040},
      {id = 2, name = "Tailor", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_y_shop_mid", x = -3169.260, y = 1043.606, z = 20.863, heading = 57.917},
      {id = 2, name = "Tailor", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_y_shop_mid", x = -1102.184, y = 2711.799, z = 19.108, heading = 223.387},
      {id = 2, name = "Tailor", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "s_f_y_shop_mid", x = -0.381, y = 6510.237, z = 31.878, heading = 310.662}
}

-------------------------------------------------------------------------------------------------
---------------------------------- DON'T EDIT THESES LINES --------------------------------------
-------------------------------------------------------------------------------------------------

-- Blip For NPC
Citizen.CreateThread(function()
	for k,v in pairs(Tailor)do
		local blip = AddBlipForCoord(v.x, v.y, v.z)
		SetBlipSprite(blip, v.BlipID)
		SetBlipScale(blip, 0.8)
		SetBlipAsShortRange(blip, true)
		BeginTextCommandSetBlipName("STRING")
		AddTextComponentString(v.name)
		EndTextCommandSetBlipName(blip)
	end
end)

-------------------------------------------------------------------------------------------------
---------------------------------- DON'T EDIT THESES LINES --------------------------------------
-------------------------------------------------------------------------------------------------

-- Spawn NPC
Citizen.CreateThread(function()
  while true do
    Citizen.Wait(0)
	
	if (not generalLoaded) then
	  
	  for i=1, #Tailor do
        RequestModel(GetHashKey(Tailor[i].modelHash))
        while not HasModelLoaded(GetHashKey(Tailor[i].modelHash)) do
          Wait(1)
        end
		
        Tailor[i].id = CreatePed(2, Tailor[i].modelHash, Tailor[i].x, Tailor[i].y, Tailor[i].z, Tailor[i].heading, true, true)
        SetPedFleeAttributes(Tailor[i].id, 0, 0)
		SetAmbientVoiceName(Tailor[i].id, Tailor[i].Ambiance)
		SetPedDropsWeaponsWhenDead(Tailor[i].id, false)
		SetPedDiesWhenInjured(Tailor[i].id, false)
		GiveWeaponToPed(Tailor[i].id, Tailor[i].Weapon, 2800, false, true)
		
      end
      generalLoaded = true
		
    end
	
  end
end)

-------------------------------------------------------------------------------------------------
---------------------------------- DON'T EDIT THESES LINES --------------------------------------
-------------------------------------------------------------------------------------------------

-- Action when player Near NPC (or not)
Citizen.CreateThread(function()
  while true do
    Citizen.Wait(0)
		RequestAnimDict("random@shop_gunstore")
		while (not HasAnimDictLoaded("random@shop_gunstore")) do 
			Citizen.Wait(0) 
		end
		
		for i=1, #Tailor do
			distance = GetDistanceBetweenCoords(Tailor[i].x, Tailor[i].y, Tailor[i].z, GetEntityCoords(GetPlayerPed(-1)))
			if distance < 4 and PlayingAnim ~= true then
				TaskPlayAnim(Tailor[i].id,"random@shop_gunstore","_greeting", 1.0, -1.0, 4000, 0, 1, true, true, true)
				PlayAmbientSpeech1(Tailor[i].id, Tailor[i].VoiceName, "SPEECH_PARAMS_FORCE", 1)
				PlayingAnim = true
				Citizen.Wait(4000)
				if PlayingAnim == true then
					TaskPlayAnim(Tailor[i].id,"random@shop_gunstore","_idle_b", 1.0, -1.0, -1, 0, 1, true, true, true)
					Citizen.Wait(40000)
				end
			else
				--don't touch this
				--TaskPlayAnim(Tailor[i].id,"random@shop_gunstore","_idle", 1.0, -1.0, -1, 0, 1, true, true, true)
			end
			if distance > 5.5 and distance < 6 then
				PlayingAnim = false
			end


		end
  end
end)
5 Likes

Stores. NOTE I might upload my Strip club when Iā€™m finished :wink:

-------------------------------------------------------------------------------------------------
---------------------------------- DON'T EDIT THESES LINES --------------------------------------
-------------------------------------------------------------------------------------------------

local generalLoaded = false
local PlayingAnim = false

-------------------------------------------------------------------------------------------------
----------------------------------- YOU CAN EDIT THIS LINES -------------------------------------
-------------------------------------------------------------------------------------------------

local StoreClerk = {
  -- ID: id of NPC | name: Name of Blip | BlipID: Icone of Blip | VoiceName: NPC Talk When near it | Ambiance: Ambiance of Shop | Weapon: Hash of Weapon | modelHash: Model | X: Position x | Y: Position Y | Z: Position Z | heading: Where Npc look
	{id = 1, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = -2511.16479492188, y = 3616.90478515625, z = 13.6422147750854, heading = 245.000457763672}, 
	{id = 2, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = 24.392505645752, y = -1345.41369628906, z = 29.4970207214355, heading = 264.900115966797},
	{id = 3, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = -47.3110542297363, y = -1758.62475585938, z = 29.4209995269775, heading = 48.1558074951172},
	{id = 4, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = 373.015, y = 328.332, z = 103.566, heading = 257.309},
    {id = 5, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = 2676.389, y = 3280.362, z = 55.241, heading = 332.305},
    {id = 6, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = 1958.960, y = 3741.979, z = 32.344, heading = 03.196},
    {id = 7, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = -2966.391, y = 391.324, z = 15.043, heading = 88.867},
    {id = 8, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = -1698.542, y = 4922.583, z = 42.064, heading = 324.021},
    {id = 9, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = 1164.565, y = -322.121, z = 69.205, heading = 100.492},
    {id = 10, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = -1486.530, y = -377.768, z = 40.163, heading = 147.669},
    {id = 11, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = -1221.568, y = -908.121, z = 12.326, heading = 31.739},
    {id = 12, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = -706.153, y = -913.464, z = 19.216, heading = 82.056},
    {id = 13, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = -1820.230, y = 794.369, z = 138.089, heading = 130.327},
    {id = 14, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = 2555.474, y = 380.909, z = 108.623, heading = 355.737},
    {id = 15, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = 1728.614, y = 6416.729, z = 35.037, heading = 247.369},
}

-------------------------------------------------------------------------------------------------
---------------------------------- DON'T EDIT THESES LINES --------------------------------------
-------------------------------------------------------------------------------------------------

-- Blip For NPC
Citizen.CreateThread(function()
	for k,v in pairs(StoreClerk)do
		local blip = AddBlipForCoord(v.x, v.y, v.z)
		SetBlipSprite(blip, v.BlipID)
		SetBlipScale(blip, 0.8)
		SetBlipAsShortRange(blip, true)
		BeginTextCommandSetBlipName("STRING")
		AddTextComponentString(v.name)
		EndTextCommandSetBlipName(blip)
	end
end)

-------------------------------------------------------------------------------------------------
---------------------------------- DON'T EDIT THESES LINES --------------------------------------
-------------------------------------------------------------------------------------------------

-- Spawn NPC
Citizen.CreateThread(function()
  while true do
    Citizen.Wait(0)
	
	if (not generalLoaded) then
	  
	  for i=1, #StoreClerk do
        RequestModel(GetHashKey(StoreClerk[i].modelHash))
        while not HasModelLoaded(GetHashKey(StoreClerk[i].modelHash)) do
          Wait(1)
        end
		
        StoreClerk[i].id = CreatePed(2, StoreClerk[i].modelHash, StoreClerk[i].x, StoreClerk[i].y, StoreClerk[i].z, StoreClerk[i].heading, true, true)
        SetPedFleeAttributes(StoreClerk[i].id, 0, 0)
		SetAmbientVoiceName(StoreClerk[i].id, StoreClerk[i].Ambiance)
		SetPedDropsWeaponsWhenDead(StoreClerk[i].id, false)
		SetPedDiesWhenInjured(StoreClerk[i].id, false)
		GiveWeaponToPed(StoreClerk[i].id, StoreClerk[i].Weapon, 2800, false, true)
		
      end
      generalLoaded = true
		
    end
	
  end
end)

-------------------------------------------------------------------------------------------------
---------------------------------- DON'T EDIT THESES LINES --------------------------------------
-------------------------------------------------------------------------------------------------

-- Action when player Near NPC (or not)
Citizen.CreateThread(function()
  while true do
    Citizen.Wait(0)
		RequestAnimDict("random@shop_gunstore")
		while (not HasAnimDictLoaded("random@shop_gunstore")) do 
			Citizen.Wait(0) 
		end
		
		for i=1, #StoreClerk do
			distance = GetDistanceBetweenCoords(StoreClerk[i].x, StoreClerk[i].y, StoreClerk[i].z, GetEntityCoords(GetPlayerPed(-1)))
			if distance < 4 and PlayingAnim ~= true then
				TaskPlayAnim(StoreClerk[i].id,"random@shop_gunstore","_greeting", 1.0, -1.0, 4000, 0, 1, true, true, true)
				PlayAmbientSpeech1(StoreClerk[i].id, StoreClerk[i].VoiceName, "SPEECH_PARAMS_FORCE", 1)
				PlayingAnim = true
				Citizen.Wait(4000)
				if PlayingAnim == true then
					TaskPlayAnim(StoreClerk[i].id,"random@shop_gunstore","_idle_b", 1.0, -1.0, -1, 0, 1, true, true, true)
					Citizen.Wait(40000)
				end
			else
				--don't touch this
				--TaskPlayAnim(StoreClerk[i].id,"random@shop_gunstore","_idle", 1.0, -1.0, -1, 0, 1, true, true, true)
			end
			if distance > 5.5 and distance < 6 then
				PlayingAnim = false
			end


		end
  end
end)
4 Likes

Fixed an Npc not facing the right way. Added in two more Npcā€™s that where missing in stores.

Feel free to let me know if I missed any :wink:

-- ID: id of NPC | name: Name of Blip | BlipID: Icone of Blip | VoiceName: NPC Talk When near it | Ambiance: Ambiance of Shop | Weapon: Hash of Weapon | modelHash: Model | X: Position x | Y: Position Y | Z: Position Z | heading: Where Npc look
	{id = 1, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = -2511.16479492188, y = 3616.90478515625, z = 13.6422147750854, heading = 245.000457763672}, 
	{id = 2, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = 24.392505645752, y = -1345.41369628906, z = 29.4970207214355, heading = 264.900115966797},
	{id = 3, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = -47.3110542297363, y = -1758.62475585938, z = 29.4209995269775, heading = 48.1558074951172},
	{id = 4, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = 373.015, y = 328.332, z = 103.566, heading = 257.309},
    {id = 5, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = 2676.389, y = 3280.362, z = 55.241, heading = 332.305},
    {id = 6, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = 1958.960, y = 3741.979, z = 32.344, heading = 296.78},
    {id = 7, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = -2966.391, y = 391.324, z = 15.043, heading = 88.867},
    {id = 8, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = -1698.542, y = 4922.583, z = 42.064, heading = 324.021},
    {id = 9, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = 1164.565, y = -322.121, z = 69.205, heading = 100.492},
    {id = 10, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = -1486.530, y = -377.768, z = 40.163, heading = 147.669},
    {id = 11, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = -1221.568, y = -908.121, z = 12.326, heading = 31.739},
    {id = 12, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = -706.153, y = -913.464, z = 19.216, heading = 82.056},
    {id = 13, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = -1820.230, y = 794.369, z = 138.089, heading = 130.327},
    {id = 14, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = 2555.474, y = 380.909, z = 108.623, heading = 355.737},
    {id = 15, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = 1728.614, y = 6416.729, z = 35.037, heading = 247.369},
	{id = 15, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = 1134.16, y = -982.44, z = 46.42, heading = 275.58},
	{id = 15, name = "Storeclerk", BlipID = 393, VoiceName = "SHOP_GREET", Ambiance = "AMMUCITY", Weapon = 0x1D073A89, modelHash = "mp_m_shopkeep_01", x = 1698.12, y = 4922.67, z = 442.06, heading = 325.11},
}
4 Likes

Wanted to thank you for such a wonderful script. Been having a blast setting up all the Npcā€™s on my server :slight_smile: Keep up all the hard work.

Thanks for the share scott but why didnā€™t you made a single script ?

Edit : No big deal, iā€™ve made a resource with 3 files. The only issue is the girls talking as man are even the clothes shop keeper saying ā€œwelcome to the ammunation !ā€.

Gonna try to fix some of these.

Hell, canā€™t figure out how to set a female voice.

Edit : Ok, changing the ambiance works.