copy z rotation in real time

so i have a cube, and i want another cube to copy the rotation along the z axis. this would be easy with animation constraints, but i cant find a logic brick setup that will do it. I hope there is some python code that will do it but i dont know python. so if someone who does could tell me how to do this i would be really happy. Thanks

if you want to do it with python you will have to use own.getOrientation() and then you have to figure out how to get the z rotation out of that

well i dont want to use python, but i see no other way