• [Gamemode] How to make player drop ammo on death?
    3 replies, posted
I'm trying to find out how to make a player drop their ammo on death (through an entity) with my limited understanding of Lua. I found this thread from about eight years ago, but the function that _nonSENSe provided makes no sense to me, and I can't find any reference for entity.isAmmo in the lua reference wiki. My guess is that thread is too old. So how can I spawn an entity that will give a player ammo when it is picked up, and then how do I spawn that entity when a player dies?
http://wiki.garrysmod.com/page/ents/Create Entity/Spawn http://wiki.garrysmod.com/page/GM/PlayerDeath http://wiki.garrysmod.com/page/Entity/GetPos Player/GiveAmmo
I've read those, and now have a basic understanding of how to create an entity at the location of the player when they die. But the question is how to make that entity give the player ammo when they pick it up, like the ammo entities in HL2. Is there a certain class I should use to specify that the entity is a box of ammo? I've been able to spawn in boxes of ammo (using the 9mm pistol ammo model), but not make them ammo-like, if that makes sense.
Don't know much about lua, but are you able to create a trigger box around ammo entity? If yes, then you can set it to remove entity and add +N ammo on player touch
Sorry, you need to Log In to post a reply to this thread.