Regenerative Ammo in a clip

I am trying to make a laser and what i want to have it do is to fire until it runs out of ammo while having the ammo in the clip keep regenerating. Any ideas?

What do you mean, if the weapon has ammo to start with then regenerate X ammo per second?

Anyway, you’re going to want to use the following links most likely, if you explain more I’ll be able to help you.

k this is what i have now but i keep getting an error.

timer.Create(“MyTimer”, 1, 0, Ammo )


function() Ammo

Uhh you should learn the basic syntax of Lua first. Call the following function once upon player initial spawn.

function ReAmmo(ply,cmd,arg)
if(ply:IsValid()) then
timer.Create(ply:Nick()…“RegenAmmo”, 1, 1, ReAmmo, ply )