Question: What is this for? Can you not simply have ammo packs on the ground in the area?
A way you can do this is to use a
game_player_equip with a keyvalue of
item_ammopack_small set to
1. You will have to disable SmartEdit to add custom keyvalues. I've set its targetname to regen_ammo_equip:
Next make a logic_timer, set its refire time to something like 6.
Now make a trigger_multple (let's name it: regen_area), have start disabled.
On the
logic_timer add these outputs:
OnTimer - regen_area - Enable ,
OnTimer - regen_area - Disable - After 0.10.
On the
regen_area trigger add an output of
OnTrigger - regen_ammo_equip - Use.
This is enough to, every 6 seconds for players in the trigger, have them 'equip' a small ammo pack. The problem is though if the player doesn't need ammo then the ammopacks will start to litter the floor because they aren't being picked up. We'll need to find a way to kill the newly spawned ammo (to stop them from building up) but keep all the existing ammopacks in the level unaffected.
To kill the ammopacks we can simply use the output on the
regen_trigger:
OnTrigger - item_ammopack_small - Kill - After 0.10
We don't want to kill all ammopacks in the level though, so we'll need to 'hide' the existing map-ammopacks before they get killed by this output:
Again on the
regen_trigger we'll add:
OnTrigger - item_ammopack_small - AddOutput - classname ammo_temp
OnTrigger - ammo_temp - AddOutput - classname item_ammopack_small - After 0.15
The full output list will look like:
Now we have all the map-ammopacks being temporarily moved to the classname of 'ammo_temp', the players in the trigger equipping the ammopacks, the unused ammopacks being killed, and the 'ammo_temp' entities moving back to regular item_ammopack_small.
You may able able to tighten when the delays happen to intervals of 0.04 instead of 0.05, but going lower than 0.04 doesn't seem to work properly since those outputs may be grouped together on the same server tick causing unwanted results.
=======
With some unwanted results but otherwise fine behavior you can alternatively use a
trigger_add_tf_player_condition with the
condition keyvalue set to
92, which says
"Player periodically regenerates ammo, health, and metal. Health regeneration rate is inversely proportional to maximum health. Used for the "Regen" powerup in Mannpower mode."