From 0eca7ae29ee4227ab05da9b235afbe77e4918ded Mon Sep 17 00:00:00 2001 From: Jim Shield Date: Fri, 2 May 2025 22:20:26 +0100 Subject: [PATCH] Fix CodeM item slot check for metadata function The slot data for CodeM apparently returns as a string, this fixes it trying to compare a string to a number ```lua if v.name == item and v.slot <= lowestSlot then ``` to ```lua if v.name == item and tonumber(v.slot) <= lowestSlot then ``` --- shared/itemcontrol.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/itemcontrol.lua b/shared/itemcontrol.lua index e7f983f..6fd0615 100644 --- a/shared/itemcontrol.lua +++ b/shared/itemcontrol.lua @@ -473,8 +473,8 @@ function getDurability(item) if isStarted(CodeMInv) then local itemcheck = exports[CodeMInv]:GetClientPlayerInventory() for _, v in pairs(itemcheck) do - if v.name == item and v.slot <= lowestSlot then - lowestSlot = v.slot + if v.name == item and tonumber(v.slot) <= lowestSlot then + lowestSlot = tonumber(v.slot) durability = v.info and v.info.durability or nil end end