How would I go about having helmets for classes

I’ve got a class select GUI that gives tools depending on which class you choose. I also have another script that reads which team the player is on and gives them specific webbings and helmets. I don’t know how I can combine both scripts to give helmets depending on which class because the class select script is kinda a bit unreadable for me. Here’s the hopperbin/ class select script.

player = script.Parent.Parent.Parent
backpack = player.Backpack

function chooseClass(class)
for i, v in pairs(backpack:GetChildren()) do v:remove() end
for i, v in pairs(class:GetChildren()) do
if v:IsA(“Tool”) then
v:clone().Parent = backpack
elseif v:IsA(“HopperBin”) then
v:clone().Parent = backpack
end
end
script.Parent.Main.Visible = false --no new class for a little bit
wait(30000)
script.Parent.Main.Visible = true --allow to pick a different class
end

for i, v in pairs(script.Parent.Main:GetChildren()) do
v.MouseButton1Up:connect(function () chooseClass(v) end)
end

Hi, please ensure you’re using the form code formatter to make it easier to read.I also recommend moving some of this to the sever-side to ensure the player has permission to get these tools. Also, can you be more specific?

Server-Side guide to communicate with server from client