Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why does the hair fall off my character!?

I have a GUI, where when you press the buttons you should change your hair.

This is the script for one of the buttons:

local choices = script.Parent.Parent.Hair.Choices

choices .choice2.MouseButton1Down:Connect(function()
	if char:FindFirstChild("Hair") then
		char:FindFirstChild("Hair"):Destroy()
	end
	local head = char:WaitForChild("Head")
	local hair = script.Hair.c2.Hair:Clone()
	hair.Handle.Position = head.Position
	hair.Parent = char
end)

when this runs, the hair just falls away, please help!

2 comments

1

Your hair is falling off because you are using hair removal shampoo.

0

can i get a real answer please

1 answer

✓ Accepted answer

because you're not using a weld to keep it on, you're just setting the position (assuming the hair is unanchored)

I recommend a WeldConstraint because they're easy to use and don't need C0/C1 set. add this code after you parent the hair

local hairWeld = Instance.new("WeldConstraint")
hairWeld.Part0 = head
hairWeld.Part1 = hair
hairWeld.Name = "HairWeld"
hairWeld.Parent = head

6 comments

0

also you might need to use remotes if the script is being run on the client.

0

Does that mean and local script changes to the character do not appear on the others?

0

and also, make sure you check and destroy any hair welds when your character is getting a new hairstyle (the button is clicked again) to prevent clutter.

0

yes it does

0

the changes will appear only for the client because your running it off a local script (unless FE was off which is impossible.) use a remote and run the hair script on the server for it to replicate

0

ok, ugh, not only do i have hair, i have skin color and faces, oh well, better make a remote

This discussion is preserved as it was. New answers, comments, and votes are closed.