A quick question...

hi so I am trying to get the keys 1 and 2 to use weapons on my server and I am getting an error in my code:



primaryList = {
{

"tfa_acr",
"tfa_ak47",
"tfa_ak74",
"tfa_amd65",
"tfa_an94",
"tfa_auga3",
"tfa_fal",
"tfa_g36",
"tfa_g3a3",
"tfa_l85",
"tfa_m14sp",
"tfa_m16a4_acog",
"tfa_m416",
"tfa_scar",
"tfa_tar21",
"tfa_val",
"tfa_winchester73",
"tfa_mp5",
"tfa_dragunov",
"tfa_honeybadger",
"tfa_intervention",
"tfa_m98b",
"tfa_mp5sd",
"tfa_aw50",
"tfa_bizonp19",
"tfa_usc"

}
}

hook.Add("PlayerSpawn", "Selects Weapons", function(ply)

    for(primary = 1, #primaryList)do
        if( ply:HasWeapon(primary) == false )then <----------------EXPECTS <name> near '('
            print("Primary Name:"..primaryList[primary].."!")
            print("Primary Number:"..primary.."!")
        end
    end

end)

hook.Add("PlayerButtonDown", "Checks Button Press", function(ply,key)
    if( key == KEY_primary or key == KEY_PAD_primary )then
        ply:ConCommand("use", primaryList[primary])
    end
end)


Help is highly appreciated.

The file is located in lua\autorun\server