I am having a problem, with ipo's and timing.

Okay let me try to explain this without stonerfying it too bad, i am making a game (FPS using shmunkymans tutorial) and i got it “shooting” using rays, and the “RayImpulse” limits the firing speed to X amount. Next i added a gun (S+W model 10 with a 4 inch barrel) and i added an ipo to the gun simulating recoil, hammer fall and the recocking of the hammer and rotating of the cylinder.

Now onto my conundrum;
I wish for the ipo of the gun to play when the RayImpulse script fires, so the gun doesnt recoil without actually firing, I have tried numerous methods so far with no success, i have tried making a property “canshoot” and having the ipo only be played hen the left mouse button is pressed AND canshoot is equal to 1, the act of firing plays the ipo and sets canshoot to 0, then in the rayimpulse scrpt i write this:

from APPLE2 import initGame,rayImpulse
own=initGame()[‘own’]
cont=initGame()[‘cont’]
rate=0.7
power=7
lmb=cont.getSensor(‘lmb’).isPositive()
ray=cont.getSensor(‘ray’)
if lmb and ray.isPositive() and own.time > rate and own.ammo>0:
if hasattr(ray.getHitObject(),‘enemy’):
ray.getHitObject().enemy=1
rayImpulse(cont.getSensor(‘ray’),power)
own.time=0
own.ammo-=1
@own.canshoot=1@

The above is the normal script with the part between the “@'s” being the part i added. this however doesnt work, it plays the ipo one time ad doesnt shoot at all.

So can anyone help me out?

Never mind i figured it out on my own (Yay me!)