check for something worn
XanMag
01 Apr 2018, 03:08So, how do I check if something is worn?
I've clicked the wearable feature. Now I can put the glasses on.
In another room, I need to check to see if the player is wearing them. How do I code that? There is no 'If player is wearing' in the GUI so I assume I have to code it in?

Dcoder
01 Apr 2018, 03:19if (glasses.worn = True) {
msg ("You can see the writing on the wall now!")
}
or
if (glasses.worn) {
msg ("You can see people's pimples now!")
}
.worn
is a built-in attribute for any (wearable) object.
J_J
01 Apr 2018, 03:20You can also set a flag when they put on the glasses called glassesworn (or whatever) and then check for the flag... I might just be lazy and use flags for everything.
XanMag
01 Apr 2018, 03:45Awesome. Thank you!