question

joeypc6 avatar image
joeypc6 asked

Cloud Script Read Customdata

I have This Code

  Townhall =  inventory.Inventory[7].DisplayName + "Level :" +  inventory.Inventory[i].CustomData("TownLevel", out continer);
         

how Can I get TownLevel For This Item instance

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Andy avatar image
Andy answered

Try:

inventory.Inventory[i].CustomData["TownLevel"].Value
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

joeypc6 avatar image joeypc6 commented ·

Nope

TypeError: Cannot read property 'Value' of undefined\n    at handlers.GetOthersInv (59A9-main.js:84:117)"
0 Likes 0 ·
Andy avatar image Andy ♦♦ joeypc6 commented ·

Woops! You're right. You don't need the ".Value" for inventory custom data, that's only for Player Data. Just this should work:

inventory.Inventory[i].CustomData["TownLevel"]

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.