Garry's Mod

Garry's Mod

Weapon Editor & Replacer
 This topic has been pinned, so it's probably important
LibertyForce  [developer] 26 May, 2017 @ 6:22am
Errors and bug report
Here you can report any errors or problems that you encounter.

Please report the following:
  • LUA errors caused by this addon (see console!). Please describe exactly what you tried to do, including the weapon class you tried to edit and the values you put in. Also be sure to copy the console output!
  • Menu issues of any kind.
  • Failure of saving or loading.
  • Issues on multiplayer servers.
  • ... and anything not stated below.

Do NOT report:
  • Lua errors caused by a weapon or it's base after editing it. Simply undo your changes. This is not supposed to be compatible with every single weapon!
  • Weapon values that can not be edited. You can't add new values to weapons... at least for now.
  • Weapon bases where the Editor doesn't work.

You can also report bugs directly at my GitHub repository.[github.com]
Last edited by LibertyForce; 26 May, 2017 @ 6:27am
< >
Showing 1-15 of 40 comments
Raffine52 26 May, 2017 @ 6:52am 
When I Replace any of the HL2 Weapons, it leaves me with this LUA Error when I tried to do so:

[Weapon Properties Editor] lua/autorun/lf_weapon_properties_editor.lua:138: attempt to index upvalue 'von' (a nil value)
1. SaveReplacement - lua/autorun/lf_weapon_properties_editor.lua:138
2. func - lua/autorun/lf_weapon_properties_editor.lua:197
3. unknown - lua/includes/extensions/net.lua:323
Last edited by Raffine52; 26 May, 2017 @ 6:53am
LibertyForce  [developer] 26 May, 2017 @ 7:21am 
Thank you for reporting this! I really messed up with a relative file path, something workshop addons apparently don't support. Hotfix is uploaded, please try again.
Last edited by LibertyForce; 26 May, 2017 @ 7:21am
BananaKnight_ 26 May, 2017 @ 8:26pm 
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=167545348
This addon isn't compatible with replacements, it make replacements useless. For example, you replace hl2 pistol with some other custom weapon, but this addon will make you pick up hl2 pistol anyway.
Maxpowerammo 26 May, 2017 @ 9:11pm 
If I block the pulse rifle, it only gives me 30 pulse ammo when I pick it up, when it should give 60.
Picking up a frag grenade doesn't give you anything either, when it should give you 1 grenade.
Last edited by Maxpowerammo; 26 May, 2017 @ 9:22pm
LibertyForce  [developer] 26 May, 2017 @ 11:37pm 
Originally posted by Maxpowerammo:
If I block the pulse rifle, it only gives me 30 pulse ammo when I pick it up, when it should give 60.
Picking up a frag grenade doesn't give you anything either, when it should give you 1 grenade.
Getting only one clip is intended.
I'm not sure if I should change this for the pulse rifle. It originally gives you 60 ammo, but since you're blocking it, you want to use it's ammo for a SWEP. It's more realistic that picking up 1 weapon = getting 1 clip. I'll think about it.

The grenades seem to need a workaround. I'll look into it.


Originally posted by ARandomPerson:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=167545348
This addon isn't compatible with replacements, it make replacements useless. For example, you replace hl2 pistol with some other custom weapon, but this addon will make you pick up hl2 pistol anyway.
I'm sorry, but I don't think I can do something about it. Due to the way hooks work in Garry's Mod, addons which manipulate the same hook won't work together. There can only be one.

In detail: Both addons hook PlayerCanPickupWeapon. If you return a value inside that hook, no further hooks will run. Addon authors have 3 choices here:
return true = Player can pick up the weapon
return false = Player can NOT pick up the weapon. It will also stay on the ground, unless you remove it manually (which I do).
return nil = The next hooks runs. If there is no other hook, the default behavior will occur.

I only return false on Weapon Replacements. That means, other hooks can still run after my addon, but only for pickups which are not replaced.
The Manual Weapon Pickup addon however, needs to return false every time, or it can't block picking up weapons automatically. Now if that addon's hook runs before my addon's hook, then mine wouldn't execute, since the other addons already returns false.

If my hook could run first, it should actually work, since I don't return a value unless it's a replacement. Unfortunately there is no reliable way of changing the order in which addon hooks run.
Last edited by LibertyForce; 26 May, 2017 @ 11:40pm
Spood 29 May, 2017 @ 4:26pm 
The HL2 weapon I am trying to replace would be gone
bolt413 30 May, 2017 @ 7:01pm 
i replace the revolver with the TFA's Revolver, it is not showing up by default when i press 2 unless i go to the menu and click on weapons, and then TFA's revolver
Lawxilim 11 Jun, 2017 @ 3:51pm 
Originally posted by LibertyForce:
Originally posted by Maxpowerammo:
If I block the pulse rifle, it only gives me 30 pulse ammo when I pick it up, when it should give 60.
Picking up a frag grenade doesn't give you anything either, when it should give you 1 grenade.
Getting only one clip is intended.
I'm not sure if I should change this for the pulse rifle. It originally gives you 60 ammo, but since you're blocking it, you want to use it's ammo for a SWEP. It's more realistic that picking up 1 weapon = getting 1 clip. I'll think about it.

The grenades seem to need a workaround. I'll look into it.


Originally posted by ARandomPerson:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=167545348
This addon isn't compatible with replacements, it make replacements useless. For example, you replace hl2 pistol with some other custom weapon, but this addon will make you pick up hl2 pistol anyway.
I'm sorry, but I don't think I can do something about it. Due to the way hooks work in Garry's Mod, addons which manipulate the same hook won't work together. There can only be one.

In detail: Both addons hook PlayerCanPickupWeapon. If you return a value inside that hook, no further hooks will run. Addon authors have 3 choices here:
return true = Player can pick up the weapon
return false = Player can NOT pick up the weapon. It will also stay on the ground, unless you remove it manually (which I do).
return nil = The next hooks runs. If there is no other hook, the default behavior will occur.

I only return false on Weapon Replacements. That means, other hooks can still run after my addon, but only for pickups which are not replaced.
The Manual Weapon Pickup addon however, needs to return false every time, or it can't block picking up weapons automatically. Now if that addon's hook runs before my addon's hook, then mine wouldn't execute, since the other addons already returns false.

If my hook could run first, it should actually work, since I don't return a value unless it's a replacement. Unfortunately there is no reliable way of changing the order in which addon hooks run.

Would it be possible to get with the creator of the manual pickup mod and with their permission write the code from that mod into yours to engage after your hook?
'vari 28 Jun, 2017 @ 2:01pm 
the menu dosent even open
Landfighter777 13 Jul, 2017 @ 11:12pm 
There is one issue I've been having, any weapon that doesn't run off a magazine, AKA Unreal Tournament sweps or the TFA weapons with no reload enabled only pick up one bullet instead of a full magazine or specific set of ammo

Hopefully this would help out in fixing(?) this or if it's just scripting being unable to do much.
Pixlbozz 17 Aug, 2017 @ 8:41am 
The addon "Do On Death" prevents the replacement.
ikuyo 13 Oct, 2017 @ 10:43pm 
i can't manually put in the numerical values for the weapons, but i can with sliders
I can't seem to edit TFA firemodes. I'm trying to edit the CSO2 M16A4 scoped to do a three-round burst, and it doesn't work. Like, no settings at all, just the greyed-out nonexistent menu text.
BananaKnight_ 3 Jan, 2018 @ 2:04am 
I think it's broken now after the recent update. It won't load my presets properly(I make a MP7 that has 40 rounds in it's magzine instead of dafault 30 rounds, but it's 30 rounds again everytime I restart my game), and this error shows up in my console everytime I start a game.

[Weapon Properties Editor] lua/autorun/lf_weapon_properties_editor.lua:341: attempt to perform arithmetic on field 'RPM' (a nil value)
1. ApplyChanges - lua/autorun/lf_weapon_properties_editor.lua:341
2. func - lua/autorun/lf_weapon_properties_editor.lua:376
3. unknown - lua/includes/extensions/net.lua:32
BananaKnight_ 3 Jan, 2018 @ 2:13am 
And it now also(somehow) breaks this addon. It makes this addon's blood effect into red crosses.

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=795055947
Last edited by BananaKnight_; 3 Jan, 2018 @ 2:13am
< >
Showing 1-15 of 40 comments
Per page: 1530 50