Newbie: property question

Hello people !

I have 3 objects:
OBkey with property: Keyprop=0
OBplayer
OBdoor with property: DoorOpenprop=0

When OBplayer touch OBkey, the property OBKey.Keyprop=1.

What i want now is to change “DoorOpenprop” from 0 to 1 when
OBKey.Keyprop=1. In other words, when player has the key, he can open the door…

How can i change the value of a property belonging to another object ?

when the player has the key send a message with the subject opendoor1.
Now when the door recives the message with the subject opendoor1 its changes the doorsopenprop to 1.

Now that was the easy way. Here is a more difficult way to do it.

do what is mentioned above except when sending the message make the body 1. (to close the door u would make the body 0)

when the door recives the subject with the opendoor1 subect run a python script. script should be :

 cont = GameLogic.getCurrentController()
sensor = cont.getSensor("name of the message sensor")
owner = cont.getOwner()

if sensor.isPositive(): #redundent but i do it anyways
     body = sensor.getBodies()
     for object in bodies:
          eval(object) #changes the string to an integer
          if object == 0:
               owner.OpenDoorProp = 0
          elif object == 1:
               owner.OpenDoorProp = 1
          else: #used to handel errors
               print """The message recived does not have a body value of 1
               or 0"""

That should work but i havent really tested it out.

if your goona make obdoor = 1 when the guy gets the key then why not just make obdoor = 1 the moment he gets the key? it would cut down on having more messages and such