Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Ammo counting down +1 every time I equip weapon?

Asked by 3 years ago

Every time I equip a weapon in my game, the ammo count goes down by 1 plus how ever many times I have equipped the weapon during the test. I can tell that is the pattern but I am not sure what to do about it.

script.Parent.Equipped:Connect(function(Mouse)
    local function Reload()
        Reloading = true
        wait(1)
        Ammo = MaxAmmo
        Reloading = false
    end

    script.Parent.Activated:Connect(function()
        if Ammo > 0 and not Reloading then
            Ammo -= 1
            print(Ammo)
            script.Parent.GunShot:Play()
            --recoils--
            if Mouse.Target.Parent:FindFirstChild("Humanoid") then
                script.Parent.DealDamage:FireServer(Mouse.Target.Parent, 20)
            end

        elseif Reloading == false then
            Reload()
            script.Parent.GunShot:Stop()
        end

1 answer

Log in to vote
0
Answered by 3 years ago

Delete line 11. I think that should work

0
That just takes away the count all together. Maybe there's a different keyword? DaGlizzzzzzyyyy 34 — 3y
Ad

Answer this question