if statments not working

hi im trying to follow a tutorial about javascripting in unity
heres the code that isn’t working

var mouseButtonDown = true;
var ammo = 100;
var timeHolding = 3;
if (mouseButtonDown == true  ammo >= 100  timeHolding == 3);
{
print ("charge attack!")
}

this is all in an update function
im getting this error in the console
“expecting ‘:’ (after the print command) found }”
if i add the : it changes to this
“unexpected token ‘}’ (under the print command)”
“‘;’ expected insert semicolon(after the end } of the function)”
“expecting } found ‘’(in a line that doesn’t exist)”

the tutorial is an older version of unity (ver 3, I’m using 4)
any help would be appreciated

You need semicolons after each statement.

–Eric

@Eric already had them forgot to put them in the original post, updated

Take the semi-colon OFF the if statement line and put it back on the print line.

Also usually a nice/essential (depending) idea to separate out those conditions on the if statement:

if ((mouseButtonDown == true)  (ammo >= 100)  (timeHolding == 3))

u have to study basic programming concepts

try this

    var mouseButtonDown = true;
    var ammo = 100;
    var timeHolding = 3;
    if (mouseButtonDown == true  ammo >= 100  timeHolding == 3)
    {
    print ("charge attack!");
    }

@stevej: you are right the semicolon at the end of the if statement was the problem thanks.
what is the advantage of putting the &s out side of the parenthesis?

off topic why doesn’t this forum have a solved button/icon?

Maybe it’s just a personal preference, but I find it a lot cleaner. It can sometimes help to avoid some unexpected results in a complex if statement - not in this case though.