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

didnt work :confused:

1 Like

has anyone found any options or a list for the “SetAmbientVoiceName” option , been searching with no luck.

1 Like

try this:
NPCLife_multiNPC.rar (2.0 KB)

you have just to replace “Police” value by that you want.

I have not found for the moment, maybe we should ask the staff.

hi, sorry for this but i can’t understand how use it, there’s a button for some menu?

can anyone help?

1 Like

Do You Have a Screen ?

I dont no why its not work - can u help me my friend :slight_smile: ?

The “strippers” are there… but they are dont talk and dont move ?

Btw i use it on FX Server ? its that the problem ?

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

local generalLoaded = false
local PlayingAnim = false

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

local ShopClerk = {
  -- 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 = "Stripper", BlipID = 52, VoiceName = "GENERIC_HOWS_IT_GOING", Ambiance = "AMMUCITY", Weapon = 0xA2719263, modelHash = "s_f_y_stripper_01", x = 112.35987854004, y = -1287.2749023438, z = 28.458688735962, heading = 100.0}, 
	{id = 2, name = "Stripper", BlipID = 52, VoiceName = "GENERIC_HOWS_IT_GOING", Ambiance = "AMMUCITY", Weapon = 0xA2719263, modelHash = "s_f_y_stripper_01", x = 112.3050994873, y = -1285.611328125, z = 28.458683013916, heading = 100.0}, 
	{id = 3, name = "Stripper", BlipID = 52, VoiceName = "GENERIC_HOWS_IT_GOING", Ambiance = "AMMUCITY", Weapon = 0xA2719263, modelHash = "s_f_y_stripper_01", x = 113.71821594238, y = -1288.1514892578, z = 28.458683013916, heading = 100.0}, 
	{id = 4, name = "Stripper", BlipID = 52, VoiceName = "GENERIC_HOWS_IT_GOING", Ambiance = "AMMUCITY", Weapon = 0xA2719263, modelHash = "s_f_y_stripper_01", x = 103.51350402832, y = -1292.2377929688, z = 29.258701324463, heading = 100.0}, 
}

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

-- Spawn NPC
Citizen.CreateThread(function()
  while true do
    Citizen.Wait(0)
	
	if (not generalLoaded) then
	  
	  for i=1, #ShopClerk do
        RequestModel(GetHashKey(ShopClerk[i].modelHash))
        while not HasModelLoaded(GetHashKey(ShopClerk[i].modelHash)) do
          Wait(1)
        end
		
        ShopClerk[i].id = CreatePed(2, ShopClerk[i].modelHash, ShopClerk[i].x, ShopClerk[i].y, ShopClerk[i].z, ShopClerk[i].heading, false, true)
        SetPedFleeAttributes(ShopClerk[i].id, 0, 0)
		SetAmbientVoiceName(ShopClerk[i].id, ShopClerk[i].Ambiance)
		SetPedDropsWeaponsWhenDead(ShopClerk[i].id, false)
		SetPedDiesWhenInjured(ShopClerk[i].id, false)
		GiveWeaponToPed(ShopClerk[i].id, ShopClerk[i].Weapon, 2800, false, true)
        -- freeze npc here
        SetBlockingOfNonTemporaryEvents(ShopClerk[i].id, 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("mini@strip_club@pole_dance@pole_a_2_stage")
		while (not HasAnimDictLoaded("mini@strip_club@pole_dance@pole_a_2_stage")) do 
			Citizen.Wait(0) 
		end
	
		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
                --emote is here:
				TaskPlayAnim(ShopClerk[i].id,"mini@strip_club@pole_dance@pole_a_2_stage","ld_girl_a_accept_cam", 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(0)
			if PlayingAnim == true then
				TaskPlayAnim(ShopClerk[i].id,"mini@strip_club@pole_dance@pole_a_2_stage","ld_girl_a_accept_cam", 1.0, -1.0, -1, 0, 1, true, true, true)
			end
			else
				--don't touch this
				--TaskPlayAnim(ShopClerk[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 = true
			end


		end
  end
end)

1 Like

that wont help you but my guess is the Ambiance = “AMMUCITY”

Nothing sexier than a stripper with gunstore’s clerk stance.

My NPClife stripper dummy arn’t moving either…

1 Like

There is no menu for this, it is necessary to add the positions recovered in game to make appear the npc the or you have indicated it

in your code:

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

local generalLoaded = false
local PlayingAnim = false

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

local ShopClerk = {
  -- 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 = "Stripper", BlipID = 52, VoiceName = "GENERIC_HOWS_IT_GOING", Ambiance = "AMMUCITY", Weapon = 0xA2719263, modelHash = "s_f_y_stripper_01", x = 112.35987854004, y = -1287.2749023438, z = 28.458688735962, heading = 100.0}, 
	{id = 2, name = "Stripper", BlipID = 52, VoiceName = "GENERIC_HOWS_IT_GOING", Ambiance = "AMMUCITY", Weapon = 0xA2719263, modelHash = "s_f_y_stripper_01", x = 112.3050994873, y = -1285.611328125, z = 28.458683013916, heading = 100.0}, 
	{id = 3, name = "Stripper", BlipID = 52, VoiceName = "GENERIC_HOWS_IT_GOING", Ambiance = "AMMUCITY", Weapon = 0xA2719263, modelHash = "s_f_y_stripper_01", x = 113.71821594238, y = -1288.1514892578, z = 28.458683013916, heading = 100.0}, 
	{id = 4, name = "Stripper", BlipID = 52, VoiceName = "GENERIC_HOWS_IT_GOING", Ambiance = "AMMUCITY", Weapon = 0xA2719263, modelHash = "s_f_y_stripper_01", x = 103.51350402832, y = -1292.2377929688, z = 29.258701324463, heading = 100.0}, 
}

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

-- Spawn NPC
Citizen.CreateThread(function()
  while true do
    Citizen.Wait(0)
	
	if (not generalLoaded) then
	  
	  for i=1, #ShopClerk do
        RequestModel(GetHashKey(ShopClerk[i].modelHash))
        while not HasModelLoaded(GetHashKey(ShopClerk[i].modelHash)) do
          Wait(1)
        end
		
        ShopClerk[i].id = CreatePed(2, ShopClerk[i].modelHash, ShopClerk[i].x, ShopClerk[i].y, ShopClerk[i].z, ShopClerk[i].heading, false, true)
        SetPedFleeAttributes(ShopClerk[i].id, 0, 0)
		SetAmbientVoiceName(ShopClerk[i].id, ShopClerk[i].Ambiance)
		SetPedDropsWeaponsWhenDead(ShopClerk[i].id, false)
		SetPedDiesWhenInjured(ShopClerk[i].id, false)
		GiveWeaponToPed(ShopClerk[i].id, ShopClerk[i].Weapon, 2800, false, true)
        -- freeze npc here
        SetBlockingOfNonTemporaryEvents(ShopClerk[i].id, 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("mini@strip_club@pole_dance@pole_a_2_stage")
		while (not HasAnimDictLoaded("mini@strip_club@pole_dance@pole_a_2_stage")) do 
			Citizen.Wait(0) 
		end
	
		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
                --emote is here:
				TaskPlayAnim(ShopClerk[i].id,"mini@strip_club@pole_dance@pole_a_2_stage","ld_girl_a_accept_cam", 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(0)
			if PlayingAnim == true then
				TaskPlayAnim(ShopClerk[i].id,"mini@strip_club@pole_dance@pole_a_2_stage","ld_girl_a_accept_cam", 1.0, -1.0, -1, 0, 1, true, true, true)
			end
			else
				--don't touch this
				--TaskPlayAnim(ShopClerk[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 = true
			end


		end
  end
end)

delete this:

-- freeze npc here
        SetBlockingOfNonTemporaryEvents(ShopClerk[i].id, true)

SetBlockingOfNonTemporaryEvents freezes npc, It is because of this that your npc does nothing :slight_smile:
For the sound, maybe the name you assigned to it is not correct, see to change it or try other :wink:

They are still not moving / danceing hmm… i can’t find any Ambiance list :smiley:

1 Like

it make way more sense now… thank you @h0ldhaven
i made 3 groups so far…

1 Like

With this script, the npc will only dance if you approach it, the basic script is used only for shops, to give them back life

If you want to dance it, you have to change the code, like this for example:

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

local generalLoaded = false
local PlayingAnim = false

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

local ShopClerk = {
  -- 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 = "Stripper", BlipID = 52, VoiceName = "GENERIC_HOWS_IT_GOING", Ambiance = "AMMUCITY", Weapon = 0xA2719263, modelHash = "s_f_y_stripper_01", x = 112.35987854004, y = -1287.2749023438, z = 28.458688735962, heading = 100.0}, 
	{id = 2, name = "Stripper", BlipID = 52, VoiceName = "GENERIC_HOWS_IT_GOING", Ambiance = "AMMUCITY", Weapon = 0xA2719263, modelHash = "s_f_y_stripper_01", x = 112.3050994873, y = -1285.611328125, z = 28.458683013916, heading = 100.0}, 
	{id = 3, name = "Stripper", BlipID = 52, VoiceName = "GENERIC_HOWS_IT_GOING", Ambiance = "AMMUCITY", Weapon = 0xA2719263, modelHash = "s_f_y_stripper_01", x = 113.71821594238, y = -1288.1514892578, z = 28.458683013916, heading = 100.0}, 
	{id = 4, name = "Stripper", BlipID = 52, VoiceName = "GENERIC_HOWS_IT_GOING", Ambiance = "AMMUCITY", Weapon = 0xA2719263, modelHash = "s_f_y_stripper_01", x = 103.51350402832, y = -1292.2377929688, z = 29.258701324463, heading = 100.0}, 
}

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

-- 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)

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

-- Spawn NPC
Citizen.CreateThread(function()
  while true do
    Citizen.Wait(0)
	
	if (not generalLoaded) then
	  
	  for i=1, #ShopClerk do
        RequestModel(GetHashKey(ShopClerk[i].modelHash))
        while not HasModelLoaded(GetHashKey(ShopClerk[i].modelHash)) do
          Wait(1)
        end
		
        ShopClerk[i].id = CreatePed(2, ShopClerk[i].modelHash, ShopClerk[i].x, ShopClerk[i].y, ShopClerk[i].z, ShopClerk[i].heading, true, true)
        SetPedFleeAttributes(ShopClerk[i].id, 0, 0)
		SetAmbientVoiceName(ShopClerk[i].id, ShopClerk[i].Ambiance)
        -- disable Drop weapon when Npc die:
		SetPedDropsWeaponsWhenDead(ShopClerk[i].id, false)
		SetPedDiesWhenInjured(ShopClerk[i].id, false)
        -- give weapon to Npc:
		GiveWeaponToPed(ShopClerk[i].id, ShopClerk[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)
		-- request anim dance
		RequestAnimDict("mini@strip_club@pole_dance@pole_a_2_stage")
		while (not HasAnimDictLoaded("mini@strip_club@pole_dance@pole_a_2_stage")) do 
			Citizen.Wait(0) 
		end

		-- request anim hello
        RequestAnimDict("random@shop_gunstore")
		while (not HasAnimDictLoaded("random@shop_gunstore")) do 
			Citizen.Wait(0) 
		end
		
		
		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
				-- If the distance is less than 4 and PlayingAnim == false
				-- NPC say hello.
				TaskPlayAnim(ShopClerk[i].id,"random@shop_gunstore","_idle_b", 1.0, -1.0, 4000, 0, 1, true, true, true)
				-- npc speak.
				PlayAmbientSpeech1(ShopClerk[i].id, ShopClerk[i].VoiceName, "SPEECH_PARAMS_FORCE", 1)
				-- set PlayingAnim to true
				PlayingAnim = true
				Citizen.Wait(4000)
				if PlayingAnim == true then
					-- If the distance is less than 4 and PlayingAnim == true
					-- NPC dance.
					TaskPlayAnim(ShopClerk[i].id,"mini@strip_club@pole_dance@pole_a_2_stage","ld_girl_a_accept_cam", 1.0, -1.0, -1, 0, 1, true, true, true)
					-- 1 second = 1000
					Citizen.Wait(15000)
				end
			else
				--don't touch this
				--TaskPlayAnim(ShopClerk[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
				-- if distance is less 5.5 or greater than 6:
				-- set PlayingAnim to false
				PlayingAnim = false
				-- Playing Emote (Not sure if it works)
				TaskPlayAnim(ShopClerk[i].id,"mini@strip_club@pole_dance@pole_a_2_stage","ld_girl_a_accept_cam", 1.0, -1.0, -1, 0, 1, true, true, true)
			end
		end
  end
end)


with this code, Normally, the npc dance if the player is away from it.
When the player approaches, the npc says hello and resumes its action.

Here is what i understand of it… MultiNPC style… they say HI but still not dance.

https://pastebin.com/JBJdmK75

So… we can RequestAnimDict as many anime as needed i guess… still learning… wonder what is missing

Still not working - i Dont understand it.

hi! all options are required? can I skip voice and ambience?

This is absolutely beautiful, thank you very much.

Have you considered making something similar but forvehicles? Being able to place immovable planes and cars in particular areas would be amazing.

1 Like

Hello @h0ldhaven & @MugiT !

I just try with this NPC : s_m_y_devinsec_01 and he moving the head so I guess it work only with specify NPC.

Actually all NPC have mens voice LOL.

1 Like

hello :slight_smile:
the voice of your npc depends on what it is (girl or boy)

some npc speak, some not also some models appears, some not.

You’re welcome.
for now no, maybe later. :slight_smile:

you can remove options if you want, to skip option, leave it empty :wink:
example: youroption=""

By any chances, does anyone has a completed file to share ?

1 Like