Question: Error, unexpected `local` declaration in procedure body

Could someone help me understand what is happening to this procedure. When I run it, I get the subject error. Thanks.

game := proc()
  local player1, player2, roll;
  roll := rand( 1..6 );
  player1 := roll():
  player2 := roll(2):
  if player1>player2 then "A wins"
  elif player1=player2 then "Tie"
  else "B wins"
  end if;
end proc:

Please Wait...