Removing spawn weapons in sandbox

How does I do it so I only spawn with physgun and gravgun? This probably has a simple answer.

Thanks in advance.

http://www.facepunch.com/showthread.php?t=765414

There’s a console command. sbox_ something. Should deal with limited weapons.

Yeah those didn’t help at all.

Do I edit gamemodes\sandbox\gamemode\init.lua ?

[lua]/---------------------------------------------------------
Name: gamemode:PlayerLoadout()
---------------------------------------------------------
/
function GM:PlayerLoadout( pl )

// Remove any old ammo
pl:RemoveAllAmmo()

if ( server_settings.Bool( "sbox_weapons", true ) ) then

	pl:GiveAmmo( 256,	"Pistol", 		true )
	pl:GiveAmmo( 256,	"SMG1", 		true )
	pl:GiveAmmo( 5,		"grenade", 		true )
	pl:GiveAmmo( 64,	"Buckshot", 	true )
	pl:GiveAmmo( 32,	"357", 			true )
	pl:GiveAmmo( 32,	"XBowBolt", 	true )
	pl:GiveAmmo( 6,		"AR2AltFire", 	true )
	pl:GiveAmmo( 100,	"AR2", 			true )
	
	
	pl:Give( "weapon_crowbar" )
	pl:Give( "weapon_pistol" )
	pl:Give( "weapon_smg1" )
	pl:Give( "weapon_frag" )
	pl:Give( "weapon_physcannon" )
	pl:Give( "weapon_crossbow" )
	pl:Give( "weapon_shotgun" )
	pl:Give( "weapon_357" )
	pl:Give( "weapon_rpg" )
	pl:Give( "weapon_ar2" )
	
	// The only reason I'm leaving this out is because
	// I don't want to add too many weapons to the first
	// row because that's where the gravgun is.
	//pl:Give( "weapon_stunstick" )

end

pl:Give( "gmod_tool" )
pl:Give( "gmod_camera" )
pl:Give( "weapon_physgun" )

local cl_defaultweapon = pl:GetInfo( "cl_defaultweapon" )

if ( pl:HasWeapon( cl_defaultweapon )  ) then
	pl:SelectWeapon( cl_defaultweapon ) 
end

end[/lua]

Should I delete lines 11-24 and 26-30?

No, set sbox_weapons to false in game.

sbox_weapons 0
So many people miss something so obvious.

sbox_weapons 0 isn’t a command according to my game.

This. Help. Console does not understand sbox_weapons 0. Removing the things in my second post did nothing. I really wanna know this.

As far as I know, to only make it so you start with those I would just put – or // in front of the guns and ammo you don’t want. Don’t remove the code, just, edit it. If that’s what your trying to do, otherwise, I’m not too sure how to do it any other way in a fashion similar to what you’re talking about.

I did what you said (but I used // instead of --, if that matters) and when I loaded up my game all my weapons were still there. It’s like whatever I do to that file doesn’t make a difference.

Because sandbox reverts to the regular sandbox every time you change the map.

Oh gee, thanks guys for not telling me that before.

What do I gotta do, make my own gamemode?

Nope.

[lua]
function WepGive(ply)
//Give physgun etc
return true // override normal hook.
end

hook.Add(“PlayerLoadout”, “givetehweps”, WepGive)

[/lua]

Stick it in autorun/server/somefile.lua

be easier to use /* and */ so much quicker…

No, you need to listen when we say that you shouldn’t modify the damn sandbox files.

No, you need to listen when I said that command didn’t work. I looked for my own solution since no one was giving me anything else.

Thanks! :smiley: I’ll try this now.

I smell a troll.

http://blogs.sltrib.com/movies/uploaded_images/troll2-748074.jpg

He be TROULLLIN