--// B_arocena

local _C = {}

function _C.RemoveHat(hts)
	for i=1, #hts do 
	if (hts[i].className == "Accessory") or (hts[i].className == "Hat") then 
	hts[i]:remove() 
end
end
end



function _C.ShirtPant (Outfit,Player,CClass)
	if CClass.Current.Value < CClass.Max.Value then
	if Player.Class.Current_Class.Value == "None" then
	if Outfit.Shirt.Value ~= 0 then
		Player.Character:WaitForChild("Shirt"):destroy()
		game:GetService("InsertService"):LoadAsset(Outfit.Shirt.Value).Shirt.Parent = Player.Character	
	end
	if Outfit.Pant.Value ~= 0 then
		Player.Character:WaitForChild("Pants"):destroy()
		game:GetService("InsertService"):LoadAsset(Outfit.Pant.Value).Pants.Parent = Player.Character
	end
	end
	end
end



function _C.GiveHat (s,CSYS,Player,Outfit,CClass)
if CClass.Current.Value < CClass.Max.Value then
	if Player.Class.Current_Class.Value == "None" then
if s.Value ~= "" then	
local g = CSYS.HATS[s.Value]:clone()
		g.Parent = Player.Character
		local C = g:GetChildren()
		for i=1, #C do
			if C[i]:IsA("BasePart")  then
				local W = Instance.new("Weld")
				W.Part0 = g.Middle
				W.Part1 = C[i]
				local CJ = CFrame.new(g.Middle.Position)
				local C0 = g.Middle.CFrame:inverse()*CJ
				local C1 = C[i].CFrame:inverse()*CJ
				W.C0 = C0
				W.C1 = C1
				W.Parent = g.Middle
				g.Middle.Transparency = 1
			end
				local Y = Instance.new("Weld")
				local Result = (s.Value):match("BACKPACK")
				if Result == nil then
				Y.Part0 = Player.Character.Head
				else
				Y.Part0 = Player.Character.Torso
				end
				Y.Part1 = g.Middle
				Y.C0 = CFrame.new(0, 0, 0)
				Y.Parent = Y.Part0
		end

		local h = g:GetChildren()
		for i = 1, # h do
			h[i].Anchored = false
			h[i].CanCollide = false
		end
end
end
end
end

function _C.giveclass (CClass,Player,CLNAME,Tools,Gui)
	if CClass.Current.Value < CClass.Max.Value then
	if Player.Class.Current_Class.Value == "None" then
	Player.Class.Current_Class.Value = CLNAME
	CClass.Current.Value = CClass.Current.Value + 1
	for i = 1, #Tools do
    Tools[i]:Clone().Parent = Player.Backpack
end
Gui:Destroy()
end
end
end

return _C
