This guide will teach you through modifying the existing code in itemInfo.lua to add ItemID numbers to the description of all items in your server. Specifically, we'll replace the current loop that processes identified descriptions with a method that concatenates all descriptions and appends the ItemID at the end of the description.
Step 1: The original code uses a loop to add identified descriptions. just remove this at your itemInfo.lua
for k, v in pairs(DESC.identifiedDescriptionName) do
result, msg = AddItemIdentifiedDesc(ItemID, v)
if not result == true then
return false, msg
end
end
Step 2: Replace the Loop
-- Concatenate identified description into a single string
local fullDescription = table.concat(DESC.identifiedDescriptionName, "\n")
-- Append the ItemID only once at the end of the full description
fullDescription = fullDescription .. "\n\n_______________________\n^0000CCItem ID:^000000 " .. ItemID
-- Add the modified full description
result, msg = AddItemIdentifiedDesc(ItemID, fullDescription)
if not result == true then
return false, msg
end
The Result will be look like this.