Jump to content
  • 0

Tutorial: Adding ItemID Numbers to All Items in Your Server in itemInfo.lua


Jinun

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   3
  • Joined:  02/15/21
  • Last Seen:  

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.

image.png.ad651e91d104dda453fcd7d4e0c75af0.png

 

 

  • MVP 1
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...