Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Unexpected token in IF Statement
heyitsrobert97 Offline
Member

Posts: 68
Threads: 29
Joined: Jan 2012
Reputation: 0
#1
Unexpected token in IF Statement

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

This Darn House! , Four Doors, Youtube
07-07-2012, 04:46 AM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#2
RE: Unexpected token in IF Statement

Remove the semicolon after void rotten01()

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

07-07-2012, 05:01 AM
Find
Fearlessagent Offline
Junior Member

Posts: 12
Threads: 2
Joined: Jul 2012
Reputation: 1
#3
RE: Unexpected token in IF Statement

(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.
07-07-2012, 05:02 AM
Find
heyitsrobert97 Offline
Member

Posts: 68
Threads: 29
Joined: Jan 2012
Reputation: 0
#4
RE: Unexpected token in IF Statement

opps lol i have a mind blank thanks Big Grin

This Darn House! , Four Doors, Youtube
07-07-2012, 05:10 AM
Find




Users browsing this thread: 1 Guest(s)