Attempt to call a "nil" value

I am having this issue for I assume no reason? As the script says there is an issue to call a value but the way I have scripted it there shouldn’t be.

Error Message :

image

Script :

local skinsFolder = game.ReplicatedStorage.Skins
local skinTypes = {skinsFolder.Weapons}


local skinsframe = script.Parent:WaitForChild("EquipSkinGuiFrame")

local skin = nil


local function updateLoadout()
	
	if skin then
		game.ReplicatedStorage.EquipSkinRE:FireServer(skin)
	end
end
updateLoadout()


for i, skinType in pairs(skinTypes) do
	
		
		
	for i, weaponChild in pairs(skinTypes:GetChildren()) do
			
		local newWeaponButton = script.SkinButton:Clone()
		newWeaponButton.Text = weaponChild.Name
			
		newWeaponButton.Parent = skinsframe
			
			
		newWeaponButton.MouseButton1Click:Connect(function()
				
			if skinType.Name == "skins" then
				skin = weaponChild
			end
				
			updateLoadout()
		end)
	end
end

Children of replicatedstorage and the script/frames :

image
image

Help would be greatly appreciated thank you!

on line 19 and 23

you looped skinTypes again

arent you supposed to put skinType instead of skinTypes

for i, weaponChild in pairs(skinType:GetChildren()) do

Oh my bad doing this helped thank you so much!