check for something worn

So, 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?


if (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

You 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.


Awesome. Thank you!


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums