Please help me Uncaught SyntaxError: Unexpected identifier


#1


// Made by damesters of The U.S. Federal Army
var placeId = 11489069; // Place to check and message
var waitTime = 5; // In seconds
var group = 2820734; // 0 for no group check, otherwise people in this group will not receive the message
function sendMsg(userId, username) {
function send() {
$.post("http://www.roblox.com/messages/send",{
subject: 'The U.S. Federal Army',
body: 'Hello, ' + username + '.\n\ My name is Ensign pumpkinizer and i'm from a group called The U.S. Federal Army. It's an amazing group focused in the timeline of the war of 1812. We're 650+ members strong and looking for new enlists to help us with the war. We hope to see you on the battlefield and in the Trainings. Much appreciated. Here is a link to the group https://www.roblox.com/My/Groups.aspx?gid=2820734,
recipientid: userId,
cacheBuster: new Date().getTime()
}).done(function(response) {
if (response.success == true) {
console.log('Sent message to ' + username + ' (' + userId + ')');
} else {
console.log('Error sending to ' + username + ': ' + response.shortMessage);
}
});
}
if (group > 0) {
$.get("http://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=" + userId + "&groupid=" + group, function(response) {
if(response.indexOf('true') == -1) {
send();
} else {
console.log('Didn\'t send a message to ' + username + ' because he is already in group ' + group + '.');
}
});


#2

Please fix the code I dont know what to do my friend created it but he will be gone for 6 weeks


#3

Right at the very end, you end it with - }); -
Remove the ); as that is not needed you only end with }

If there's still a syntax error let me know,


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.