Ammo supply crates

I’ve been wanting to get an Ammo supply crate like the ones from the Half Life 2 campaign… I always liked the green crates/trunks full of ammo. I couldn’t find what I’m looking for, but I could have been wrong on how I worded my searches. I was wondering if anyone could make supply crates that you can spawn through entities. Also I wasn’t absolutly sure which forum this would go in, but if anyone could help me out on this thank you. :slight_smile:

Put this code in your /lua/autorun/server.

[lua]concommand.Add(“spawn_crate”,function(ply,cmd,args)
local crate = ents.Create(“item_ammo_crate”)
crate:SetPos(ply:GetEyeTrace().HitPos)
crate:SetAngles(ply:GetForward():Normalize():Angle())

crate:SetKeyValue("AmmoType",1)
timer.Simple(15,function() crate:Remove() end)

end)[/lua]

And type “spawn_crate” in console.

Why have it get removed after 15 seconds? lol

Oh my god the necro…

Can you consider quit the forums?

For asking a question?
Can you consider soiside xd

I’ve never heard of “soiside”, could you elaborate?

You’re either uneducated or a troll I can’t tell… but you definitely don’t know lua.

Don’t play dumb, you know you think about it every day :^)

[editline]2nd November 2016[/editline]

Don’t know lua? I’m not the uneducated one :^)