Garry's Mod Lua Error - DarkRP!

Hey guys!

[DarkRP] gamemodes/darkrp/gamemode/modules/base/sh_util.lua:34: attempt to compare number with table
  1. formatMoney - gamemodes/darkrp/gamemode/modules/base/sh_util.lua:34
   2. setDarkRPItem - gamemodes/darkrp/gamemode/modules/f4menu/cl_menuitem.lua:155
    3. buttonFactory - gamemodes/darkrp/gamemode/modules/f4menu/cl_entitiestab.lua:76
     4. Fill - gamemodes/darkrp/gamemode/modules/f4menu/cl_categories.lua:112
      5. SetCategory - gamemodes/darkrp/gamemode/modules/f4menu/cl_categories.lua:94
       6. createCategories - gamemodes/darkrp/gamemode/modules/f4menu/cl_entitiestab.lua:94
        7. generateButtons - gamemodes/darkrp/gamemode/modules/f4menu/cl_entitiestab.lua:246
         8. unknown - gamemodes/darkrp/gamemode/modules/f4menu/cl_entitiestab.lua:8

Getting that error after adding this entity in to the server as a custom entity:

DarkRP.createEntity("556x45MM Ammo", {
	ent = "cw_ammo_556x45",
	model = "models/Items/BoxSRounds.mdl",
	price = 500,
	max = 2,
	cmd = "buy556",
        sortOrder = 100, -- The position of this thing in its category. Lower number means higher up.

The thing is, is that the entity works and spawn the ammo, just getting this error.

Looking for a hand, thanks!

Seems to be an issue with your f4 menu. Did you make it yourself? If not, are you using the most recent version?

Yeah man, F4 Menu is working fine, complete stock and from the most recent version of DarkRP.

This error only happened after I added the entity for ammo in, but the error doesn’t affect any part of gameplay.

Look at all the default ammo that comes with the f4 menu. Are they created the same way? Are there any custom fields that the menu uses to determine the position of the ammo on the menu? I can’t tell without seeing all the code, but from what it looks like, it’s having trouble deciding where to put the buttons on the f4 menu.

The F4 Menu’s ammo buttons are all fucked up!

I tried creating the 5.56 as an ammo type first but it wouldn’t work, (using the ammo crate of 5.56 as the entity to spawn when purchased through ammo tab), but then retried that using the entities tab and it was fine.

I was unable to make a custom ammo group for the 5.56 so I went to this method instead.