Timer Error

Not going to bother posting the full code but this is the part giving me problems…


 
   self.Owner:EmitSound("weapons/gauss/chargeloop.wav")
   timer.Simple(4.5,self.Owner:StopSound("weapons/gauss/chargeloop.wav"))
   timer.Simple(4.6,self.Owner:EmitSound("HL1/fvox/beep.wav"))


My timers are failing and I’m apparently too stupid to undersand why - Timer Error: attempt to call a nil value

You are passing the return values to those functions to the timer as the callback, here is how you should do it:

[lua]timer.Simple(4.5, self.Owner.StopSound, self.Owner, “weapons/gauss/chargeloop.wav”)
timer.Simple(4.6, self.Owner.EmitSound, self.Owner, “HL1/fvox/beep.wav”)[/lua]

I’m not quite sure I understand what you’re saying but I think I understand the layout, so thank you.

So… if I am seeing this right and wanred it to reload after the timer I’d use something like…

timer.Simple(4.5, self.Owner.SetAnimation, self.Owner, ACT_VM_RELOAD) ?

Exactly.