hook.Add into PlayerLoadout
Player is the first argument, check :Team( ), or whatever; then :Give( “fas2_ak47” ) or whatever for each loadout.
I’d recommend doing a direct access sort of thing. Here’s some code I wrote for a gun-game / gun-race style game-mode as a tutorial: https://dl.dropboxusercontent.com/u/26074909/tutoring/_gamemode_logic/gun_race/upgrade_weapons_for_kills.lua.html
And a TTT style of system for giving out weapons based on groups and other info - two examples done on the begin-round segment, it’d go into PlayerLoadout for yours unless it is TTT: https://dl.dropboxusercontent.com/u/26074909/tutoring/_gamemode_logic/give_weapons_based_on_group.lua.html
Now, for VGUI where you have a menu open and you select a load-out, it is simply a DButton or DImageButton where you override the .DoClick function, and send a net-message to the server telling the server which loadout you want. The server in a net.Receive would then dispense the same way the other scripts are used.
Here’s an MOTD to show how the DoClick stuff is done: https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/motd.lua.html
And a networking tutorial: https://dl.dropboxusercontent.com/u/26074909/tutoring/networking/networking_booleans.lua.html
For yours you may want to set up ENUMERATIONS, basically SHARED CONSTant values like LOADOUT_1 = 1, LOADOUT_2 = 2, LOADOUT_3 = 99, etc… and just WriteInt or to make it easier without counting bytes, WriteLong or Float or Double - forget which ones exist… On the other end, local _value = net.ReadXXX() and if _value == LOADOUT_1 then… elseif == LOADOUT_2 then … elseif == _3 then … else end…