Not a function exactly like that, but there are ways to check if there is a platform.
You could choose to create coins only when platforms are created and only in the same (relative) position of the platform.
An example:
make an instance variable for the platform (coins)
on platform created: set coins to floor(random(4))
add a subevent
sytem compare two values: platform.coins = 1 :
- create coin at platform.x, platform.y-25
and another
sytem compare two values: platform.coins = 2 :
- create coin at platform.x-(platform.width/4), platform.y-25
- create coin at platform.x+(platform.width/4), platform.y-25
and another
sytem compare two values: platform.coins = 3 :
- create coin at platform.x, platform.y-25
- create coin at platform.x-(platform.width/5), platform.y-25
- create coin at platform.x+(platform.width/5), platform.y-25
This way they are also evenly placed along the platform.
If coins is 0 no coins are created.
Ok, I got a bit carried away here, the code might be a bit difficult for a beginner, but the best option I think is creating the coins on creating the platform, that way you can place them within the platform width.