I made one out of bricks yesterday by coincidence...
With the help of zone-events:
First you must give the brick a zone to secure, also be sure to activate it.
Then give the turret a relay event to activate the shooting, i will edit later to get the list of events here if you want me to.