invisible [boolean] [false]
keyboard(shift) -> AND -> visible (invisible)
__________________-> property (invisible = TRUE)
playerInvisible [boolean] [false]
This is the basic way of doing it via logic bricks. To summarize when you set the player to be invisible, also send a message to the cube or to all objects that you want effected telling them that the player is invisible. Then set their “playerInvisible” property to be true. Now hook up any logic bricks that you want to say the cube and have it only work when “playerInvisible” property is true.
That was the messy logic brick way of doing it. You can do it via python easily by obtaining the player object via python and just checking to see if the property “invisible” of the player object is set to true, then just execute whatever script or logic you have hooked up to the cube. You can find out how to get objects in a scene from here http://www.blender.org/documentation/pydoc_gameengine/PyDoc-Gameengine-2.34/KX_Scene.KX_Scene-class.html.