How to put any hair on a player without manually putting in values

  1. What do you want to achieve? I am trying to apply hair without having to change the values each time.

  2. What is the issue? One hair would fit on perfectly, the rest would not fit.

  3. What solutions have you tried so far? Tried manipulating values, but nothing would work.

script.Parent.FocusLost:Connect(function()
	workspace.StartingModel.Men.Hairs:ClearAllChildren()
	game.ReplicatedStorage.LoadAsset:FireServer(script.Parent.Text)
	wait(.3)
	local handle = workspace.StartingModel.Men.Hairs:FindFirstChild(script.Parent.Text):FindFirstChildOfClass("Accessory").Handle
	local plr = workspace.StartingModel.Men
	workspace.StartingModel.Men.Hairs:FindFirstChild(script.Parent.Text):FindFirstChildOfClass("Accessory").Handle.Transparency = 0
	handle.Position = plr.Head.Position
	local Weld = Instance.new("Weld")
	Weld.Parent = handle
	Weld.Part0,Weld.Part1 = plr.Head,handle
	Weld.C0 = CFrame.new(0,0.84,0)
	Weld.C1 = plr.Head.HairAttachment.CFrame
	
end)

Use a rigidconstraint then modify the attachments manually so they are at the bottom of the hair scalp. Then create an offset of Vector3.new(0,0.5,0) for the other attachment which will be parented to the players head.

Use AddAccessory, the calculations are handled for you.
https://developer.roblox.com/en-us/api-reference/function/Humanoid/AddAccessory