pants = script.Parent.Pants:GetChildren()
shirts = script.Parent.shirts:GetChildren()
faces = script.Parent.Faces:GetChildren()
hairs = script.Parent.Hair:GetChildren()
maindummy = game.Workspace.Camera.Dummy_3D
dummy = script.Parent.Dummy
repeat wait() until maindummy and dummy and hairs and faces and shirts and pants
script.Parent["Pant Label"].Next.MouseButton1Click:connect(function()
local lastSpawn = nil
repeat
local curSpawn = pants[math.random(1,#pants)]
until curSpawn ~= lastSpawn
lastSpawn = curSpawn
wait() --Let the Character fully load
maindummy.Pants.PantsTemplate = "http://www.roblox.com/asset/?id="..curSpawn
dummy.Pants.PantsTemplate = maindummy.Pants.PantsTemplate
end)
line 16 is errored, Players.Player.PlayerGui.CreateChar.CharChange:16: attempt to concatenate global 'curSpawn' (a nil value)

2 comments
Are you meaning to grab the template from the faces to use on the pants? Because that's what it looks like in line 12.
Reread it.