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

Custom hair comes off my head when I touch other player? HELP!!!

Ok. So I made my character have custom hair, and it is an accessory with a handle in it named Handle, and in that is a mesh. I want to know - why does the hair get transferred from me to another player when I touch them? It is really annoying. Thank you - here is my code where I create the hair.

local acc = Instance.new("Accessory", char.Head)
acc.Name = "SSJHair"
local handle = Instance.new("Part", char.Head.SSJHair)
handle.Name = "Handle"
handle.CanCollide = false
handle.BrickColor = BrickColor.new("Lime green")
handle.Transparency = 1
handle.Material = "Neon"
local weld = Instance.new("Weld", handle)
weld.Name = "AccessoryWeld"
weld.Part0 = handle
weld.Part1 = char.Head
weld.C0 = CFrame.new(0, -0.5, 0)
local mesh = Instance.new("SpecialMesh", handle)
mesh.MeshId = "rbxassetid://430344159"
mesh.Offset = Vector3.new(0, 0.5, 0.5)
mesh.Scale = Vector3.new(6, 6, 6)
local attachment = Instance.new("Attachment", handle)
attachment.Name = "HairAttachment"
attachment.Position = Vector3.new(0, 0.1, -0)
attachment.Axis = Vector3.new(1, -0, 0)
attachment.SecondaryAxis = Vector3.new(0, 1, 0)
if acc:FindFirstChild("TouchInterest") ~= nil then
	acc:FindFirstChild("TouchInterest"):Destroy()
end

1 answer

After the hair is put on the head, be sure to disable the script.

local acc = Instance.new("Accessory", char.Head)
acc.Name = "SSJHair"
local handle = Instance.new("Part", char.Head.SSJHair)
handle.Name = "Handle"
handle.CanCollide = false
handle.BrickColor = BrickColor.new("Lime green")
handle.Transparency = 1
handle.Material = "Neon"
local weld = Instance.new("Weld", handle)
weld.Name = "AccessoryWeld"
weld.Part0 = handle
weld.Part1 = char.Head
weld.C0 = CFrame.new(0, -0.5, 0)
local mesh = Instance.new("SpecialMesh", handle)
mesh.MeshId = "rbxassetid://430344159"
mesh.Offset = Vector3.new(0, 0.5, 0.5)
mesh.Scale = Vector3.new(6, 6, 6)
local attachment = Instance.new("Attachment", handle)
attachment.Name = "HairAttachment"
attachment.Position = Vector3.new(0, 0.1, -0)
attachment.Axis = Vector3.new(1, -0, 0)
attachment.SecondaryAxis = Vector3.new(0, 1, 0)
if acc:FindFirstChild("TouchInterest") ~= nil then
    acc:FindFirstChild("TouchInterest"):Destroy()
script.Disabled = true
end

2 comments

0

That would work, except for the fact that what I put down is only part of the script. Disabling the script would disable the whole entire thing I was creating and you couldn't use it ever again.

0

Not if you use it correctly.

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