Yeah, I got that part. I have changed the code slightly so now it loops and the reload code is a label in the actual reload command as oppose to the animation command. There is still a problem though, the animation freezes right at the start of the reload. here's my code:
keyboard_Reload:
`Reloading (press R)
IF keystate(19)=1 AND shooting=0 AND ClipSize < MaxClipSize AND Ammo > 0
reload=1
endif
if reload = 1
Play_Animation("Reload_start")
if Reloaddelay > Timer()
Reloaddelay = Timer() + 500
Play_Animation("Reload")
loop sound ShotgunReload
endif
if object frame(Shotgun) > (ani_reload2 - 0.5)
Ammo = Ammo - 1
ClipSize = ClipSize + 1
endif
if ClipSize = MaxClipSize or Ammo = 0
Play_Animation("Reload_end")
play sound ShotgunCock
reload = 0
endif
endif
return
Function Play_Animation(Action$)
Select Action$
case "Retrieve":
play object shotgun, ani_retrieve1, ani_retrieve2
endcase
case "Idle":
loop object shotgun, ani_idle1, ani_idle2
endcase
case "Move":
loop object shotgun, ani_move1, ani_move2
endcase
case "Reload_start":
play object shotgun, ani_start_reload1, ani_start_reload2
endcase
case "Reload":
loop object shotgun, ani_reload1, ani_reload2
endcase
case "Reload_end":
play object shotgun, ani_end_reload1, ani_end_reload2
endcase
case "Fire":
play object shotgun, ani_fire1, ani_fire2
endcase
`Scope
case "Scope_Start":
play object shotgun, ani_start_zoom1, ani_start_zoom2
endcase
case "Scope_Idle":
loop object shotgun, ani_zoom_idle1, ani_zoom_idle2
endcase
case "Scope_Move":
loop object shotgun, ani_zoom_move1, ani_zoom_move2
endcase
case "Scope_Fire":
play object shotgun, ani_start_zoom_fire1, ani_end_zoom_fire2
endcase
case "Scope_Reset":
play object shotgun, ani_end_zoom1, ani_end_zoom2
endcase
`end of scope
endselect
ENDFUNCTION
NOTE: the function is called as needed. The label keyboard_reload is called every loop of the main loop. Also, the variables (such as reload) are global
Any ideas as to why?