...learning RGSS.
Okay, okay... Now, listen. An element set is a list of the item's elements. It's recorded on it all the elements of it. That kind of list (Array) has a method called .include? to check if that list has a value registered. Returns TRUE when the value is on the list and FALSE otherwise. Now, remember that it keeps only its elements! The rest isn't included.
If you know about "if", skip this paragraph. "If"s are conditions: it says what happens when something is TRUE. There are two kinds of "if" lines: pre-"if" and post-"if". Pre-"if"s are most common. It's line is written like this: if (condition). The condition is evalued and, when true, the next lines are executed until it finds an "end" line, that'll close the last TRUE-evalued pre-"if". If it is FALSE-evalued, it skips to its "end" line. Every pre-"if" line has an end line. Post-"if"s are different. It is put on a common line of the script, and is written as: (do something) if (condition). In this case, there's no "end" line. "Do something" will only be executed if "condition" is TRUE-evalued.
You may know that the item object has the Array "element_set" property. You may not know that you must get, first, the item object (from $data_items). Soo, you can access "element_set" of the item by $data_items[i_id].element_set, where "i_id" is the item id. You'll probably be using a variable there. *cough "i" cough cough* ...Well, now you're able to figure it out how to make it work! :D
SEE YA!!!!!
Obs: No, I won't tell you the code like that. Better help you finding it than giving it. Jijingo!