Random Item Box

This should be pretty easy: I would like a Box that when you press E on it spawns a random entity/weapon from a list (The box would then disappear). So basically by editing the lua i could choose what could be randomly spawned from the box.

Is this what you want?
http://cdn.solidfiles.net/info_imgs/CEtS.jpg
You can change the weapons it spawns at the top of addons/randombox/lua/entities/gmod_randombox/init.lua

Thanks its great! I was just wondering how would i add a delay to the weapon spawning?

You can replace the MakeGun function in init.lua with:



function MakeGun(ent)
	local Pos = ent:GetPos()

	timer.Simple(0.3, function()
		local e = ents.Create(table.Random(Weapons))
		e:SetPos(Pos+Vector(0,0,5))
		e:Spawn()
		e:Activate()
	end)

	ent:Remove()
end


And change the 0.3 to a different number.

Thanks man!