local MyGamemode = MyGamemode or {}
--Create An Overall Table For Our Gamemode
--Set The Value Of The Table To Itself
--Or
--If It Has No Value Set The Value To An Empty Table
--Make A Custom Function In Our Table
function MyGamemode.PlayerInitialSpawn( Ply )
--Add A Variable To Our Player Entity
Ply.SpawnEquipment = {}
Ply.SpawnEquipment.Weapons = {}
--Insert A Custom Value To The Table
table.insert( Ply.SpawnEquipment.Weapons, "weapon_crowbar" )
--Example Of Clearing The Table And Adding New Weapons
table.Empty( Ply.SpawnEquipment.Weapons )
--Insert A Different Weapon
table.insert( Ply.SpawnEquiment.Weapons, "weapon_ar2" )
--And Another
table.insert( Ply.SpawnEquiment.Weapons, "weapon_pistol" )
end
--Hook Into The GM:PlayerInitialSpawn()
hook.Add( "PlayerInitialSpawn", "MyCustomInitalspawnFunction", MyGamemode.PlayerInitialSpawn )
--Give The Player Their Spawn Equipment
--Override The PlayerLoadout Function So ONLY Our Equipment Is Given
function GM:PlayerLoadout( Ply )
local Equipment = Ply.SpawnEquipment
--Make Sure Equipment Is Not nil
if ( Equipment != nil ) Then
local Weapons = Equipment.Weapons
--Make Sure Weapons Is Not nil
if ( Weapons != nil ) then
--Loop Through Our Weapons Table
--k == Table Key, 1,2,3,4,5..
--v == Table Value
for k,v in pairs(Weapons) do
--Give The player Each Weapon In The Equipment Table
Ply:Give( v )
end
end
end
end