Detect if player is reloading

How can I tell if a player is reloading? The only way I can think of is with ply:KeyDownLast(), but that doesn’t work with automatic reloads (when the clip runs out).

Also, why is there no hook for this? Same thing should go with attack1 and attack2 :S (Though there might be clientside hooks for those, didn’t check)

The hook is here and more here

Well yes, that would be the case if I was making a SWEP, but I’m running a normal serverside script (not sure what they’re supposed to be called) so I need a Gamemode hook. Or is it possible to use SWEP hooks from outside the SWEP script?

I am not sure so I’ll give you my best guess; You could hook **[Gamemode.DoAnimationEvent](** and check the current event.

local function MyFunc(pl, event, data)
– do something
hook.Add(“DoAnimationEvent”, “CheckPlayerReload”, MyFunc)

Yes, that worked :smiley: And it’s only called once for each reload, so it’s perfect. Thanks!