A "legislator" is someone whose job is to write and vote on laws.
The word "legislator" is general so that it can apply to lawmakers in a variety of different government systems. These are more specific terms:
- a member of Parliament
- a Senator
- a Congressman / Congresswoman
- an Assembly member