Jyn Posted July 1, 2019 Report Posted July 1, 2019 For whatever reason I cant seem to get any values from defIndex. From the first log each item in my backpack is just being returned as having a defIndex of undefined. what is annoying too is that tf2.backpack[i].id works fine to get the specific item id's. Code below: tf2.on('backpackLoaded', function () { log("Loaded our backpack."); lookforrefined() }); function lookforrefined() { var refcount = 0; for (i = 0; i <tf2.backpack.length; i++) { log(tf2.backpack[i].defIndex); // only returning 'undefined' if (tf2.backpack[i].defIndex === 5002) { refcount++; log("foundref"); } } log(refcount) }; Quote
Dr. McKay Posted July 1, 2019 Report Posted July 1, 2019 As of v3, properties are not converted from snake_case to camelCase. So instead of using defIndex, you need to use def_index. Quote
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.
Note: Your post will require moderator approval before it will be visible.