I made a script to apply shirts and pants to the dummy. I attempted this and it seemed not to work or show any errors. What did I do wrong:
local MaleShirts = {
"https://www.roblox.com/catalog/10476909222/",
"https://www.roblox.com/catalog/14867469174/",
"https://www.roblox.com/catalog/2043393684/",
"https://www.roblox.com/catalog/10702131770/",
"https://www.roblox.com/catalog/11560229918/"
}
local MalePants = {
"https://www.roblox.com/catalog/9824426986/",
"https://www.roblox.com/catalog/12215267334/",
"https://www.roblox.com/catalog/11560229918/",
"https://www.roblox.com/catalog/18219332947/",
"https://www.roblox.com/catalog/2043393899/"
}
local MaleHair = {
"https://www.roblox.com/catalog/12887129839/",
"https://www.roblox.com/catalog/12911961302/",
"https://www.roblox.com/catalog/16314636793/",
"https://www.roblox.com/catalog/15569172395/",
"https://www.roblox.com/catalog/18653473304/"
}
local FemaleShirts = {
"https://www.roblox.com/catalog/15234276594/",
"https://www.roblox.com/catalog/5926636822/",
"https://www.roblox.com/catalog/6287440679/",
"https://www.roblox.com/catalog/9252177953/",
"https://www.roblox.com/catalog/8078107210/"
}
local FemalePants = {
"https://www.roblox.com/catalog/12600337570/",
"https://www.roblox.com/catalog/2779197890/",
"https://www.roblox.com/catalog/2779197890/",
"https://www.roblox.com/catalog/4677181042/",
"https://www.roblox.com/catalog/479104585/",
"https://www.roblox.com/catalog/6737011903/"
}
local FemaleHair = {
"https://www.roblox.com/catalog/15643738220/",
"https://www.roblox.com/catalog/88388283433140/",
"https://www.roblox.com/catalog/17343731641/",
"https://www.roblox.com/catalog/17120262338/",
"https://www.roblox.com/catalog/14146138094/"
}
local function assignAppearance()
local gender = math.random(1, 2) == 1 and "Male" or "Female"
local shirtID = ""
local pantsID = ""
local hairID = ""
if gender == "Male" then
shirtID = MaleShirts[math.random(1, #MaleShirts)]
pantsID = MalePants[math.random(1, #MalePants)]
hairID = MaleHair[math.random(1, #MaleHair)]
else
shirtID = FemaleShirts[math.random(1, #FemaleShirts)]
pantsID = FemalePants[math.random(1, #FemalePants)]
hairID = FemaleHair[math.random(1, #FemaleHair)]
end
local humanoid = script.Parent:FindFirstChildOfClass("Humanoid")
local head = script.Parent:FindFirstChild("Head")
local shirt = Instance.new("Shirt", script.Parent)
local pants = Instance.new("Pants", script.Parent)
shirt.ShirtTemplate = shirtID
pants.PantsTemplate = pantsID
end
assignAppearance()