Or you can do it like this laugh
Code:
var collected_coins = 0; // doesn't have any coins yet

action coin() // attach this action 
{
	while(vec_dist(my.x,player.x) > 50)//while player is far than 50 quants
	{
		my.pan += 5 * time_step; // turn my pan
		wait(1);
	}
	//if player is closer than 50 quants
	collected_coins += 1; // add one coin then
	// can play some sound here 
}




Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung