in my FPS there is a burst fire mode but sometimes when the ammo the gets low it takes to much. For example lets say there is 2 bullets in the mag it will still take 3 and not take 2 so the ammo will be -1
Here is my script
if shooting and ammo > 0 and burst then for i = 1,3 do shoot() wait(60/722) end wait(.125) shooting = false end
so how would i stop this from occuring again please help me
Thanks
You arent checking if the ammo has enough ammo for the burst.
if shooting and ammo > 0 and burst then for i = 1,3 do shoot() wait(60/722) end wait(.125) shooting = false end
In the script below I check and see if there is still ammo left, if not it breaks out of the loop.
if shooting and ammo > 0 and burst then for i = 1,3 do shoot() wait(60/722) if ammo <= 0 then break end end wait(.125) shooting = false end
Hope this helped!