All NPCs have the same clothing!

Hello,

I am scripting a city NPC System and I want them to all have the same clothes!

The problem is that they all use the same Clothes/Accessories/Hair, and I have looked everywhere for help, and couldn’t understand any of them! Is there anyone out there to help?

Here is the script

	local Hair = {80921949,32278814,212961935,15913837,188003563,77799954,185812332,295456068
		,74174889,13655562,83013207,80922154,343584973,62743701,4735347390,4212534746,
	}
	local i = game:GetService("InsertService")
	local lel = random:NextInteger(1,#Hair) 
	local E = i:LoadAsset(Hair[lel])  
	local Hair_01 = E:FindFirstChildOfClass("Accessory") 
	Hair_01.Name = "HAIR"
	if not script.Parent:FindFirstChild('HAIR') then
		Hair_01.Parent = script.Parent
	end

Thank You!

Here is a photo.

2 Likes

Replace HairID with the hairstyle ID you want all NPCs to have. This way, all NPCs will have the same hairstyle.

Remember to ensure that the hairstyle you’re using is a valid accessory ID that’s available in your game. You can find these accessory IDs by looking them up on the Roblox catalog or through Roblox Studio’s Asset Manager.

local HairID = 80921949 -- You can choose any hairstyle ID from your list
local i = game:GetService("InsertService")
local E = i:LoadAsset(HairID)
local Hair_01 = E:FindFirstChildOfClass("Accessory")
Hair_01.Name = "HAIR"
if not script.Parent:FindFirstChild('HAIR') then
    Hair_01.Parent = script.Parent
end
1 Like

No I meant I don’t want all of the NPCs to have the same hairstyle.

edit: i found the fix nvm

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.