The original code is written in Python, but it looks like you might be writing in JavaScript. The two languages use different syntax, a type of format with rules. You need to follow the correct syntax for the language you are writing in.
Python:
if pos.x == 34:
JavaScript
if (pos.x == 34) {
If you need specific help, post your code and someone can walk you through it. Below is a link that will help you post your code properly so we can help.