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

Mouse Wheel| Script Giving Error? [Edited]

Asked by 8 years ago

Idea When ever a player scrolls it will either print 0 for tool 1 or 1, for tool 2.
New Problem I get this error:18:25:02.643 - Players.Player.PlayerGui.ToolHandler2:14: attempt to perform arithmetic on upvalue 'tool' (a boolean value)
Code:

local player = game.Players.LocalPlayer
local char = player.Character

local mouse = player:GetMouse()
local tool = 0

mouse.WheelForward:connect(function()
   tool = tool + 1
   if tool >= 2 then 
      tool = tool - tool 
   end
end)
mouse.WheelBackward:connect(function()
   tool = tool - 1
   if tool <= 0 then
      tool = tool == 1
   end
end)

while wait() do
   if tool == 0 then
    print"0"
   elseif tool == 1 then
print"1"
end

Thanks :D

2
you're missing an end NotSoNorm 777 — 8y
0
o_0 pluginfactory 463 — 8y

Answer this question