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

Error from tool using value?

Asked by
adatax 5
8 years ago

I have this "gun" that lowers in value every time player clicks. When the ms value equals zero however i get this error Players.Player.Backpack.Tool.Blanka Blanka!:12: attempt to perform arithmetic on global 'ms' (a boolean value)

tool = script.Parent
plr = game.Players.LocalPlayer

mags = 5
ms = 5

tool.Equipped:connect(function(mse)
    mouse = mse
    mouse.Button1Down:connect(function()
        if active then
            print"Shot"
            ms = ms -1
            print(ms)
            if ms == 0 then
                ms = 5 and mags == mags -1
                if mags == 0 then
                end
            end
            active = false
        else
            active = true
        end
    end)
end)
tool.Unequipped:connect(function()
    mouse:disconnect(con)
end)

Answer this question