help with if

how doe s the if command works ???
because i thougt that the if command should be used like this:
because i thougt that the if command should be used like this:
- Code: Select all
if(sub = 5){
ChangeAnimation("player", "submarine", FORWARD);
DestroyActor("water");
}