Select a different group of weapons to be spawned each round(TTT)

I’ve no idea how to make a lua code that will select randomly between a group of guns and spawn them around the map, for example: I have some NEW CSS weapons and the classic ones, I want to make it so one round it spawn the classic, and the other round it’ll spawn the new css guns…

Bump
This is really important for me, please help.

add me on steam: awatemonosan

Added but if anyone still wants to help feel free to post here, because I don’t know whether or not that guy will help me.


function SwapWeapons
    --Define weapon lists
        --2 weapon lists because i'm fucking lazy.
    WeaponList={
        {
            "weapon_pistol",
            "weapon_crowbar"
        },
        {
            "weapon_ar2",
            "weapon_rpg"
        }
    }


    --Pick a random list
    ChosenList=table.Random(WeaponList)


    --Create a list of all weapon spawnpoints and remove the weapons
    WeaponSpawnPoints={}


    for k, v in pairs( ents.GetAll() ) do
        if v:IsWeapon() then
            table.insert(WeaponSpawnPoints,v:GetPos())
            v:Remove()
    end


    --Place random weapons at each of the points
    for k, v in pairs( WeaponSpawnPoints ) do
        weapon = ents.Create(table.Random(ChosenList))
        weapon:SetPos(v)
        weapon:Spawn()
    end


    --Done. Magic.
end


hook.Add( "TTTPrepareRound", "SwapWeapons", SwapWeapons)




untested but i’m sure you can figure it out from here if it errors. If not you have need to go back to the basics and read the lua guides.

Awesome, thanks for everything.
This thread can be closed now