Frictional Games Forum (read-only)
[SCRIPT] Unexpected token in IF Statement - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Unexpected token in IF Statement (/thread-16800.html)



Unexpected token in IF Statement - heyitsrobert97 - 07-07-2012

Hi, I've got this random problem where my cs won't load. the error says line 176,1 Unexpected Token. but the token has to be there.

void rotten01();
{ <------- Error here ?
if(GetLocalVarInt("rottenkeyuse") == 2)
{
RemoveItem("rotten_key");
GiveSanityBoost();
}
}

any help please


RE: Unexpected token in IF Statement - Damascus - 07-07-2012

Remove the semicolon after void rotten01()

It doesn't belong at the end of functions, so it doesn't understand the brackets.


RE: Unexpected token in IF Statement - Fearlessagent - 07-07-2012

(07-07-2012, 04:46 AM)heyitsrobert97 Wrote: Hi, I've got this random problem where my cs won't load. the error says line 176,1 Unexpected Token. but the token has to be there.

void rotten01();
{ <------- Error here ?
if(GetLocalVarInt("rottenkeyuse") == 2)
{
RemoveItem("rotten_key");
GiveSanityBoost();
}
}

any help please
the semicolon ( ; ) on the line above the error doesn't belong there. Semicolons are only needed after statements, not function headers.


RE: Unexpected token in IF Statement - heyitsrobert97 - 07-07-2012

opps lol i have a mind blank thanks Big Grin