Problem with NPC clothes

Hello, :wave:
I’ve got a problem with my NPC.

  1. What do you want to achieve? I would like that when NPCs appear, they have random clothes.

  2. What is the issue? The problem is that the output tell me that asset type does not match requested type, even if a shirt ID is provided in the shirt template, and same problem with pants.

  3. What solutions have you tried so far? I already searched on the Dev Forum, but haven’t found something.

Here’s my code :

local Part = script.Parent
local SP = game.Workspace.System_PNJ
local Shirt= {
	"http://www.roblox.com/asset/?id=6709022132",
	"http://www.roblox.com/asset/?id=2287241646",
}
local Pants= {
	"http://www.roblox.com/asset/?id=2074786498",
	"http://www.roblox.com/asset/?id=6713980852",
}

while true do
	wait(math.random(3,10))
	if SP.NBPnj.Value < 14 then
		local Cha = SP.Dummy:Clone()
		Cha.Pant.PantsTemplate =Pants[math.random(1,#Pants)]
		Cha.Shirt.ShirtTemplate =	 Shrit[math.random(1,#Shirt)] 
		Cha.Parent = game.Workspace
		Cha.Humanoid.WalkSpeed = 20
		Cha.Name = "Customer"
		Cha.Humanoid.DisplayName = " "
		Cha.Torso.CFrame = CFrame.new(script.Parent.Position)
		
		
		local Client = Cha
		local humanoid = Client.Humanoid
		local destination = game.Workspace.System_Commande.Entree
		
		local PathfindingService = game:GetService("PathfindingService")
		local path = PathfindingService:CreatePath()
		path:ComputeAsync(Client.HumanoidRootPart.Position, destination.Position)
		
		local waypoints = path:GetWaypoints()
		
		for _, waypoint in pairs(waypoints) do
			local part = Instance.new("Part")
			part.Shape = "Ball"
			part.Material = "Neon"
			part.Size = Vector3.new(0.6, 0.6, 0.6)
			part.Position = waypoint.Position
			part.Anchored = true
			part.CanCollide = false
			part.Transparency = 1
			part.Parent = game.Workspace

			humanoid:MoveTo(waypoint.Position) --Line 44

			humanoid.MoveToFinished:Wait()
			
		end
		end
end

Studio tells me this when I launch a test :

 18:39:01.068  Image https://assetdelivery.roblox.com/v1/asset?id=4924696137 failed to load. Error 403: Asset type does not match requested type  -  Studio
  18:39:01.071  Image https://assetdelivery.roblox.com/v1/asset?id=7827765699 failed to load. Error 403: Asset type does not match requested type  -  Studio

If someone know how to fix this, your welcome…
Thanks.

Those are the clothing catalog IDs not the IDs of their templates, try the follow instead.

local Shirt= {
	"http://www.roblox.com/asset/?id=6709022128",
	"http://www.roblox.com/asset/?id=2287241646",
}
local Pants= {
	"http://www.roblox.com/asset/?id=2074786498",
	"http://www.roblox.com/asset/?id=6713980843",
}
1 Like