I’m trying to make a server, but I keep getting Syntax Error: "unexpected identifier"
…
I have done things like this:
JavaScript
x
6
1
if (AFK === true
2
3
alert("server AFK")
4
5
}
6
JavaScript
1
6
1
if Boolean(AFK)
2
3
alert("server AFK")
4
5
}
6
JavaScript
1
6
1
if (AFK
2
3
alert("server AFK")
4
5
}
6
The same error comes up…
I have a Boolean as well, so I had to put this:
JavaScript
1
2
1
var AFK = true
2
It is a thing to tell you if the server is AFK or not. The server is NOT working yet, I’m just seeing some errors with detecting boolean values…
Any way you could help?
Advertisement
Answer
The syntax is:
JavaScript
1
3
1
if (condition)
2
statement1
3
So you should change it to:
JavaScript
1
4
1
if (AFK === true) {
2
alert("server AFK")
3
}
4