I'm just winging this, since I'm at work now and can't test it... but given your inventory key is identified with INV_KEY, I think it might look like:
In your room, define a key Prop:
(instance keyOnTable of Prop
(properties
x 100
y 130
view 100
)
)
In your room's init method:
// If the inventory key is owned by this room, make the "key on table" visual show up:
(var invItem)
(= invItem (send gInv:at(INV_KEY)))
(if (send invItem:ownedBy(gRoomNumber))
(keyOnTable:init())
)
Then in the RoomScript's handleEVent method:
(if (Said('put/key/table'))
(if (send gEgo:has(INV_KEY))
(send gEgo:put(INV_KEY gRoomNumber)) // Give inventory key from the ego to the room
(keyOnTable:init()) // Make the "key on table" visual show up
)
(else
Print("You don't have the key")
)
)