The laser turret is tied into the current town PVP setting, and may fire at players when they approach:

/townpvp off - Defensive mode, turrets will fire at non-citizens

/townpvp on - PVP mode, turrets fire at everyone

/townpvp bounty - PVP mode, turrets fire at everyone

/townpvp dungeon - turrets fire at everyone

/townpvp safe - (NEW) Safe mode, turrets fire at no one

Wilderness - turrets fire at everyone

Depending on town mode, the turret may take damage if a player attacks it. If so, the turret will go offline for a while before reinitializing. (The turret does not get destroyed by damage, only temporarily disabled).

Laser Turrets are available to Level 5 players for 5 plat in Shop > Traps.