"Fussy" Container

The adventure I'm writing features a chocolate machine and a pile of pennies.

I'm trying to write a script so that if the player puts the pile of pennies in the machine, something happens, but if he tries to put anything else in, he gets the message "It won't fit in the slot."

I saw the bit in the Tutorial about how to set up a "fussy" container, which seems to be almost what I want to do, but I need a different IF statement.

I've tried

if (object.article = pile of pennies) {

with and without double quotes around "pile of pennies", but either way when I play the game and try to put the pennies in the machine, the game doesn't recognise it and instead goes to the Else clause and gives the message about them not fitting in the slot.

What have I got wrong?

object.article is usually "he", "she", or "it".

What you want is probably:

if (object = pile of pennies) {

Ah yes, that works!

Many thanks

I see the way you shine
Take your hand, my dear, and place them both in mine run 3 hot games.

Spam alert

Sorry double post

Log in to post a reply.