local plr = game.Players.LocalPlayer
local c = plr.Character
local gui = plr:WaitForChild("PlayerGui").main
local back = gui.character_custom.Background
local hairleft = back.hair_scroll.left
local hair = back.hair_scroll
local rp = game:GetService("ReplicatedStorage")
local Hatsc = rp.CC.Hats:GetChildren()
local Hats = rp.CC.Hats
local CC1 = game.Workspace.CC1
local CC2 = game.Workspace.CC2
local CC3 = game.Workspace.CC3
local CC4 = game.Workspace.CC4
local CD1 = CC1.Dummy
local CD2 = CC2.Dummy
local CD3 = CC3.Dummy
local CD4 = CC4.Dummy
local CC = plr:FindFirstChild("CC")
page = 1
pagemax = #Hatsc
pagemin = 1
script.Parent.MouseButton1Click:connect(function()
page = page - 1
hairleft.Visible = true
local sc = plr.PlayerScripts.CameraM
sc.Disabled = false
if page == pagemin then
hairleft.Visible = false
else
hairleft.Visible = true
for _, v in pairs(Hats:GetChildren()) do
local hat = v
script.Parent.Parent.Text = v.Name
if CC.Value == 1 then
if CD1:FindFirstChildOfClass("Accessory") then
local remove = CD1:FindFirstChildOfClass("Accessory")
remove:Destroy()
local hat = v:Clone()
hat.Parent = CD1
else
local hat = v:Clone()
hat.Parent = CD1
end
elseif CC.Value == 2 then
if CD2:FindFirstChildOfClass("Accessory") then
local remove = CD2:FindFirstChildOfClass("Accessory")
remove:Destroy()
local hat = v:Clone()
hat.Parent = CD2
else
local hat = v:Clone()
hat.Parent = CD2
end
elseif CC.Value == 3 then
if CD3:FindFirstChildOfClass("Accessory") then
local remove = CD3:FindFirstChildOfClass("Accessory")
remove:Destroy()
local hat = v:Clone()
hat.Parent = CD3
else
local hat = v:Clone()
hat.Parent = CD3
end
elseif CC.Value == 4 then
if CD4:FindFirstChildOfClass("Accessory") then
local remove = CD4:FindFirstChildOfClass("Accessory")
remove:Destroy()
local hat = v:Clone()
hat.Parent = CD4
else
local hat = v:Clone()
hat.Parent = CD4
end
end
end
end
end)
my problem is it will load the default hair but no others even though there are more in the folder this is on a textbutton with a LocalScript

2 comments
Any output errors?
Nope