So I have 2 functions (both deprecated, IK) and they work in Roblox Studio but on the regular game launched on the website or the app the only function that works is the wheelforward function. The functions look like this:
function WheelForward()
if AimingIn == true then
if Debounce == true then
Debounce = false
print("Forward")
if Camera.FieldOfView == 70 then
for i = 1, 10 do
Camera.FieldOfView = Camera.FieldOfView - 1
wait()
end
game.Lighting.DOF.FarIntensity = 0.215
game.Lighting.DOF.NearIntensity = 0.215
Camera.FieldOfView = 60
end
Debounce = true
end
end
end
function WheelBackward()
if AimingIn == true then
if Debounce == true then
Debounce = false
print("Backward")
if Camera.FieldOfView == 60 then
for i = 1, 10 do
Camera.FieldOfView = Camera.FieldOfView + 1
wait()
end
game.Lighting.DOF.FarIntensity = 0.1
game.Lighting.DOF.NearIntensity = 0.35
Camera.FieldOfView = 70
end
Debounce = true
end
end
end
“Camera” is workspace.CurrentCamera btw.
I have figured out why it’s not working… kind of. What happens is when I’m scrolling forward it works but when I scroll backward after I scroll forwards it just prints, I think it’s something to do with the if statement but I don’t know why, the FOV is 50 when I scroll backward, just like it is when I scroll forward.
Just if you want to know; the functions get called in an Equipped function/event with the mouse from the function/event.