Basically, it's a script where when you click a hair on a GUI, the hair appears on your character, but if you click on a different hair the hair appearing on character disappears and the other appears, if that makes any sense. It all works up to the point that the first hair doesn't disappear when the other is clicked. See my script here:
function onButtonClicked()
game.Players.LocalPlayer.leaderstat.Hat.Value = 10
if game.Players.LocalPlayer.leaderstat.Hat.Value == 10 then
hair = game.ReplicatedStorage.CBeauty:Clone()
hair.Name = "Hair"
hair.Parent = game.Players.LocalPlayer.Character
local w = Instance.new("Weld")
w.Part0 = game.Players.LocalPlayer.Character.Head
w.Part1 = hair
w.Parent = game.Players.LocalPlayer.Character.Head
w.C0 = w.C0 * CFrame.new(-0,-0.5,0.2)*CFrame.fromEulerAnglesXYZ(0, math.pi, 0)
wait(0.3)
elseif game.Players.LocalPlayer.leaderstat.Hat.Value ~= 10 then
hair:Remove()
end
end
script.Parent.MouseButton1Click:connect(onButtonClicked)

3 comments
Don't use :Remove its deprecated. Use :Destroy instead.
Oh wow I never knew :Remove() got deprecated ._.
I tried the same with :Destroy but no difference.