This is just a simple example of an online game. For better example, look at this page on the wiki(https://en.scratch-wiki.info/wiki/Creating_a_Multiplayer_Game) NOTE: The one on the wiki doesn't seem to work, not entirely sure why but I presume that it is because there isn't a delay between updating the player check variables.
You don't need to give credit to me if you use this/change it.