Whenever I walk near a weapon in Gmod I pick it up. I want to know what I have to do in Hammer to have an SMG be able to get picked up with only the USE key. (I'm using gmod)
Disable the trigger box with this function: [url]http://wiki.garrysmod.com/page/Entity/UseTriggerBounds[/url]
[editline]22nd October 2016[/editline]
This cannot be done map-side to my knowledge as the BaseCombatWeapon will set the trigger bounds itself, initially
[QUOTE=code_gs;51246393]Disable the trigger box with this function: [url]http://wiki.garrysmod.com/page/Entity/UseTriggerBounds[/url]
[editline]22nd October 2016[/editline]
This cannot be done map-side to my knowledge as the BaseCombatWeapon will set the trigger bounds itself, initially[/QUOTE]
I don't know how to use this, do I write it somewhere in the map's text file, is there any entity I can put this code in to?
If this uses LUA I want you to know idk how to use that,
If you only want to do this with mapping, you could use a prop_dynamic with a world model of the weapon you want to pick up. Then you create a button around the weapon, and use a point_template to spawn the actual weapon entity where the player will be standing at pressing +use on the weapon. Finally make it delete the button and prop_dynamic. This will have the exact effect you're asking for.
Otherwise you're going to have to do some Lua.
[QUOTE=code_gs;553816]Disable the trigger box with this function: [url]http://wiki.garrysmod.com/page/Entity/UseTriggerBounds[/url][/QUOTE]
[url]http://i.imgur.com/Ci8V24w.png[/url]
I copy pasted "Entity:UseTriggerBounds( boolean enable, number bloat=0 )" from the linked page into a .lua file and I keep getting that error. I don't have any experience but can you guys help me with the typing? (also the .lua file is named mop)
[QUOTE=Flonger;51248247][url]http://i.imgur.com/Ci8V24w.png[/url]
I copy pasted "Entity:UseTriggerBounds( boolean enable, number bloat=0 )" from the linked page into a .lua file and I keep getting that error. I don't have any experience but can you guys help me with the typing? (also the .lua file is named mop)[/QUOTE]
I would use the method Rory described as it will work with every Source game and not require hardcoded MapID entities in the code.
[QUOTE=Rory;51246859]If you only want to do this with mapping, you could use a prop_dynamic with a world model of the weapon you want to pick up. Then you create a button around the weapon, and use a point_template to spawn the actual weapon entity where the player will be standing at pressing +use on the weapon. Finally make it delete the button and prop_dynamic. This will have the exact effect you're asking for.
Otherwise you're going to have to do some Lua.[/QUOTE]
There's just one problem with this, the gun can only spawn in one place on the map, is there any way I can make it spawn next to the player who pressed the button?
Sorry, you need to Log In to post a reply to this thread.