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

My Ammo Checker For My Gun Script doesn't work and there is no error in the output can you help me?

Asked by 5 years ago

I was gonna make a reload script But I thought "Why Shouldn't I test it first" so I made my ammo checker but the problem was My ammo checker did not work

this is ammo checker

while true do 
if Ammo < 0 then
    CanFire = false

else
    CanFire = true
    end
wait()
end


you can see if the ammo is 0 or Below 0 its making CanFire False

if you want you can see the other lines that I use CanFire

--Shooting The Gun
    local function fire()
        if CanFire == true then
    local ray = Ray.new(tool.Barrel.CFrame.p, (mouse.Hit.p - tool.Barrel.CFrame.p).unit * Range)

        script.Parent.Remotes.Shoot:FireServer(tool, ray)
        end
--AutoFire
    mouse.Button1Down:connect(function()
       button1down = true
        repeat fire() wait(0.199) until
        button1down == false
        CanFire = false
0
if Ammo <= 0 ?? mixgingengerina10 223 — 5y
0
only works when I drop and pick it up again IAMNOTABOT303 0 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

nevermind It didn't work because it was not in the right code sorry for wasting time :/

Ad

Answer this question