Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to equip multiple hairs at once?

Asked by
Lagfss 36
2 years ago

I was scripting a customization system where I want them to be able to mix and max different hairstyles. Currently, its works with only 1 hairstyle but idk how to make them blend

local hair_2 = game.ReplicatedStorage.Hair["Hair(2)"]
local char = plr.Character
local head = char.Head

local folder = char.Head.Hair


local new_hair_2 = hair_3:Clone()
new_hair_2.Parent = folder
new_hair_2.Position = head.Position
local weld = Instance.new("Weld")
weld.Parent = new_hair_2
weld.Part0,weld.Part1 = head, new_hair_2
weld.C0 = CFrame.new(0,1,0)
weld.C1 = head.HairAttachment.CFrame

This is the system I'm using to equip it which works But rn I'm currently wondering if its possible to be able to have it equip 2 hairs at once

1 answer

Log in to vote
0
Answered by
imKirda 4491 Moderation Voter Community Moderator
2 years ago

it surely is possible but you should give more context to the question, anyway, to make 2 hairstyles you :Clone twice and make one more weld:

local hair_2 = game.ReplicatedStorage.Hair["Hair(2)"]
local hair_3 = game.ReplicatedStorage.Hair["Hair(3)"]

local char = plr.Character
local head = char.Head

local folder = char.Head.Hair

local new_hair_2 = hair_2:Clone()
new_hair_2.Parent = folder
new_hair_2.Position = head.Position

local new_hair_3 = hair_3:Clone()
new_hair_3.Parent = folder
new_hair_3.Position = head.Position

local weld_1 = Instance.new("WeldConstraint")
weld_1.Parent = new_hair_2
weld_1.Part0, weld_1.Part1 = head, new_hair_2

local weld_2 = Instance.new("WeldConstraint")
weld_2.Parent = new_hair_3
weld_2.Part0, weld_2.Parent1 = head, new_hair_3

instead of Weld you can use WeldConstraint which is a newer weld and when using it you don't need to change C0 and C1, it does it for you.

Ad

Answer this question