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)ifnot result ==truethenreturnfalse, msg
endend
Step 2: Replace the Loop
-- Concatenate identified description into a single stringlocal 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)ifnot result ==truethenreturnfalse, msg
end
Question
Jinun
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
Step 2: Replace the Loop
The Result will be look like this.
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.