Here's my coins function using particles. Note: coinimage must be global.
function docoins(xpos as integer, ypos as integer, coinamount as integer)
ClearParticlesForces(11)
AddParticlesForce ( 11, 0.3, 0.5, 300-(xpos*5), -300 )
// set up particles
SetParticlesPosition ( 11, xpos, ypos )
SetParticlesDepth(11,2)
ResetParticleCount ( 11 )
SetParticlesFrequency ( 11, 10 )
SetParticlesLife ( 11, 0.8 )
SetParticlesSize ( 11, 5 )
SetParticlesStartZone ( 11, -1, 0, 1, 0 )
SetParticlesImage ( 11, coinimage )
SetParticlesDirection ( 11, 3, -10 )
SetParticlesAngle ( 11, 30 )
SetParticlesVelocityRange ( 11, 1.8, 2.5 )
SetParticlesMax ( 11, coinamount )
AddParticlesColorKeyFrame ( 11, 0.0, 255, 255, 255, 255 )
AddParticlesColorKeyFrame ( 11, 0.7, 255, 255, 255, 255 )
AddParticlesColorKeyFrame ( 11, 0.8, 255, 255, 255, 0 )
endfunction
In your game loop, you can call docoins(x,y, number of coins you want to appear) whenever you want coins to appear. You'll need to tweak the values so the spawned coins do what you want them to do, but you should be able to figure it out.