We are going to create 2 new variables ON THE PLATFORM SPRITE. One called "y" and one called "costume". IT IS IMPORTANT TO CHECK "FOR THIS SPRITE ONLY" ON THESE TWO VARIABLES!
On your Platforms sprite, create a new custom block.
Name it "Set Platforms" and check the Run without screen refresh box.
And add this code to it.
Finally, add these two blocks of code to your platform sprite.