Skip to Content

Item Object Documentation

Overview

The Item object in GrowSoft provides global and instance-level access to item data, including name, rarity, type, grow time, and reward values.
Most functions are used with either the global accessor getItem(itemID) or the object method item:getName().


Accessing Item Data

getItem(itemID) -- Returns the global item data object for a given item ID.
ℹ️

Global Item Data

The getItem() function provides access to server-wide item properties that apply to all instances of that item.


Item Information

item:getID() -- Returns the item's ID. item:getName() -- Returns the item's name. item:getRarity() -- Returns the item's rarity. item:getPricedRarity() -- Returns numeric rarity based on real-GT prices (0-7, higher = more rare). item:getActionType() -- Returns the item's action type (e.g., clothing, seed). item:getCategoryType() -- Returns the category type of an item. item:getEditableType() -- Returns the editable type of an item. item:getClothingType() -- Returns the clothing type of the item. item:getNetID() -- Returns the item's net ID. item:getTexture() -- Returns the texture name that the item uses (string). item:getTextureX() -- Returns the X coordinate of the texture (number). item:getTextureY() -- Returns the Y coordinate of the texture (number).

Priced Rarity

The getPricedRarity() method returns a numeric value (0-7) representing how rare an item is based on real Growtopia market prices:

local item = getItem(242) -- World Lock local rarity = item:getPricedRarity() -- Rarity scale: 0 = no info, 1-7 = increasing rarity -- Higher numbers mean more rare/expensive items if rarity >= 5 then print("This is a very rare item!") elseif rarity == 0 then print("No rarity information available") end

Rarity Scale:

  • 0 - No information available
  • 1 - Common
  • 2 - Uncommon
  • 3 - Rare
  • 4 - Very Rare
  • 5 - Epic
  • 6 - Legendary
  • 7 - Mythical

Growth & Behavior

item:getGrowTime() -- Returns the item's grow time in seconds. item:setGrowTime(seconds) -- Sets the grow time for an item globally. item:setActionType(type) -- Sets the action type for an item globally. item:setCategoryType(value) -- Sets the category type of the item globally. item:setClothingType(typeID) -- Sets the clothing type ID of the item globally. item:setEditableType(value) -- Sets the editable type of the item globally.

Description & Display

item:setDescription(text) -- Sets the description for an item globally.

Item Value & Economy

item:setPrice(price) -- Sets the price of the item. item:isObtainable() -- Returns true if the item is obtainable. item:getObtainability() -- Returns info about where the item can be obtained (like book of knowledge).

Item Effects

Manage and query item effects from the item manager:

item:getEffects() -- Returns table with item's effects from item manager. item:setEffects(data) -- Sets item effects without needing to restart server.

Effect Properties:

  • extra_gems - Extra gems percentage bonus
  • extra_xp - Extra XP percentage bonus
  • one_hit - One-hit break ability (0 or 1)
  • break_range - Break range increase
  • build_range - Build range increase

Example:

local item = getItem(98) -- Pickaxe -- Get current effects local effects = item:getEffects() print("Current extra gems: " .. effects.extra_gems) -- Set new effects (automatically saves to item effects panel in dashboard) item:setEffects({ extra_gems = 500, extra_xp = effects.extra_xp, one_hit = effects.one_hit, break_range = effects.break_range, build_range = effects.build_range }) -- Verify changes local newEffects = item:getEffects() print("New extra gems: " .. newEffects.extra_gems)
ℹ️

Automatic Saving

When you use item:setEffects(), the changes are automatically saved and displayed in the item effects section of the dashboard. No server restart required!


XP & Gem Rewards

item:getGems(world, player) -- Returns the number of gems an item would drop, optionally considering player buffs. item:getXP(world, player) -- Returns the amount of XP an item would give, optionally considering player buffs.
ℹ️

Buff-Aware Calculations

The getGems() and getXP() functions can consider player buffs when calculating rewards!

Last updated on