Garry's Mod

Garry's Mod

48 ratings
Random Amount For Ammo Boxes & Healing Items
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Weapon
Addon Tags: Fun, Realism
File Size
Posted
Updated
3.505 KB
18 Jan, 2024 @ 12:48pm
23 Feb, 2024 @ 12:26pm
3 Change Notes ( view )

Subscribe to download
Random Amount For Ammo Boxes & Healing Items

In 1 collection by Coffee Man
Coffee Man's Gameplay-Enhancing Addons
67 items
Description
Simple script for Garry's Mod. Changes ammo boxes and health items to give random amounts on pick up.




Features:
  • The following entity items give random amounts of bullets when picked up, their min / max ranges are:

    item_ammo_357 [2 - 6]
    item_ammo_357_large [2 - 6]
    item_ammo_ar2 [8 - 27]
    item_ammo_ar2_large [8 - 27]
    item_ammo_crossbow [1 - 3]
    item_ammo_pistol [5 - 14]
    item_ammo_pistol_large [5 - 14]
    item_ammo_smg1 [11 - 35]
    item_ammo_smg1_large [11 - 35]
    item_box_buckshot [2 - 6]

  • The following healing items give random amounts of effect when picked up, their min / max ranges are:

    item_healthkit [10 - 25]
    item_healthvial [5 - 10]
    item_battery [5 - 15]

  • These changes may slightly increase game difficulty if you're a bozo scrub.




Limitations:
  • In order to ensure as much compatibility as possible for this public release, some features from my own version had to be removed or simplified.

  • The maxAmmo variable that prevents pick ups when the player has max ammo for that particular item has been increased to 9999.




Credits:


5 Comments
JayHog1992 22 May @ 5:32am 
Any way to recreate this mod with ammo from NPC weapons? Would be nice the idea that you only get a portion of the ammo left in enemy's magazine without picking up spare ammo. Instead of a fixed amount.
ゴ『O c e a n M a n』ゴ 28 Nov, 2024 @ 12:45pm 
After searching for actual years for a mod that would let me limit the amount of ammo received per pick up I was glad to come across this. Regrettably it doesn't seem to work with vmanip, but I won't be choosy, this is perfect for setting up a survival horror scenario.
Dallas Worksman 13 Jul, 2024 @ 8:38am 
Can you do that with M9k Ammo please ?
I4Q 4 Jun, 2024 @ 5:14am 
@Coffee Man
Very useful code, man. Thank you! I've been missing a similar ammo limitation system for a long time. To my surprise, there are very few similar addons in the workshop... And yet, some improvements would not hurt. If you have free time and desire, could you add support for grenades and slam, like the code that sets the maximum possible amount that a player can take? No matter how hard I try to add a limiter on their number, I can't do it, simply because "weapon_frag" with "npc_grenade_frag" do not belong to the ammo class, but as weapons
CokedBadger 26 May, 2024 @ 12:14pm 
Can you maybe add another Entities category with ammo and health pickups that give the original amount? For those times when you want pre-set pickups to be random, but want the amount you spawn to be specific