Your motor is running out of gas (fuel) before you even get going. An older bike might have rust in the tank plugging the filter or the float level got moved somehow. The level of gas inside the carb has to be high enough for the motor suction to pull the fuel out through the different jets. Low speed uses small jets that can get plugged easy (but your engine idles so that does not seem what is wrong). To move at half speed there is a slightly larger jet that might be plugged. Then to go any faster than 3/4 throttle the main jet finally starts being used. It is quite large and hardly ever gets plugged. But the main jet often screws in and holds the intermediate jet which is the middle speed jet. Once I had a brand new bike with a full tank of gas and the air vent in the filler cap was plugged, no air in means no gas coming out so the engine dies, (there is usually a small air leak enough to let the engine idle.) If the tank was only 1/2 full it would work ok for about a half mile, stop, air would leak in then you could go another 1/2 mile etc.