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
9 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)

01tool = script.Parent
02plr = game.Players.LocalPlayer
03 
04mags = 5
05ms = 5
06 
07tool.Equipped:connect(function(mse)
08    mouse = mse
09    mouse.Button1Down:connect(function()
10        if active then
11            print"Shot"
12            ms = ms -1
13            print(ms)
14            if ms == 0 then
15                ms = 5 and mags == mags -1
View all 27 lines...

Answer this question