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

Why went wrong?

Asked by
sebsa 0
9 years ago

When I run the WheelForward function it works fine, but when I run the WheelBackward function nothing happens? I can't seem to find the problem and I need help.

local Player = game.Players.LocalPlayer
local Camera = game.Workspace.CurrentCamera
local debounce = false
local Min = 50
local Max = 70
local Mouse = Player:GetMouse ()


Mouse.WheelForward:connect (function()

if debounce == true then return end
debounce = true
if Camera.FieldOfView == Max then
    for FOV = Camera.FieldOfView, Min, -.5 do
        Camera.FieldOfView = FOV
        wait ()
    end
end
wait ()
debounce = false
end)

Mouse.WheelBackward:connect (function()

if debounce == true then return end
debounce = true
if Camera.FieldOfView == Min then
    for FOV = Camera.FieldOfView, Max, .5 do
        Camera.FieldOfView = FOV
        wait ()
    end
end
wait ()
debounce = false
end)

Answer this question