How the code works is explained using note inside the project. Feel free to use. The basics of how this works is that it tricks the player into thinking the player is moving, when it's really the map moving.
This is a demo of a scrolling map made for @DaBaby_YeahYeah123 Forum link: https://scratch.mit.edu/discuss/topic/570204/?page=1#post-5926125