It will take a certain amount of setup to make this work. It depends
on what the effect your after. This is very generic code, but it does
demonstrate coding logic of sorts to employ collision.
You may want to do something like this:
do
if mouseclick()=1 and fire = 0
targetx# = object position x(target)
targety# = object position y(target)
targetz# = object position z(target)
point object bullet,targetx#,targety#,targetz#
fire = 1
endif
if fire = 1
move object bullet,1.0
if object collision(bullet,target) = 1
delete object bullet
play object target
play sound 1
destroyed = 1
endif
if destroyed = 1 and object playing(target) = 0
delete object target
destroyed = 0
fire = 0
endif
endif
sync
loop