I’m trying to work on a homestore, and I’m trying to make a section that has UGC hair combos. I’ve managed to make some mannequins & figured out how to sell them properly + how to remove existing hats.
I’m trying to make it so that when a player clicks on the hairs, it makes them wear all of the hairs on the mannequin.
Attatched is a picture of said mannequin:
And here’s the code (Which I took from a free model hat giver which works) which is copied into each of the handles/hitboxes:
debounce = true
function onTouched(hit)
if (hit.Character:findFirstChild("Humanoid") ~= nil and debounce == true) then
debounce = false
local h = Instance.new("Hat")
local p = Instance.new("Part")
h.Name = script.Parent.Parent.Name
p.Parent = h
p.Position = hit.Character:findFirstChild("Head").Position
p.Name = "Handle"
p.formFactor = 0
p.Size = Vector3.new(0,0,0)
p.BottomSurface = 0
p.TopSurface = 0
p.Locked = true
script.Parent.SpecialMesh:clone().Parent = p
h.Parent = hit.Character
h.AttachmentPos = Vector3.new(0,0,0)
wait(5)
debounce = true
end
end
script.Parent.ClickDetector.MouseClick:Connect(onTouched)
When I click this, it only gives one hair and not all of them. How do I make it so it wears all 3 at once?