---@param id number
---@param slot number
local function useButton(id, slot)
if PlayerData.loaded and not invBusy and not lib.progressActive() then
local item = PlayerData.inventory[slot]
if not item then return end
local data = Items[item.name]
local buttons = data?.buttons
if buttons and buttons[id]?.action then
buttons[id].action(slot)
end
end
end
replace to this
---@param id number
---@param slot number
local function useButton(id, slot)
if PlayerData.loaded and not invBusy and not lib.progressActive() then
local item = PlayerData.inventory[slot]
if not item then return end
local data = exports.fmid_split:GetItemData(PlayerData.inventory, slot)
local buttons = data?.buttons
if buttons and buttons[id]?.action then
buttons[id].action(slot)
end
end
end