local start_wheel = 0 local mod = 0 local zoom_speed = 1 --how fast you zoom while scrolling the mouse wheel local init_mod = 10 --how far to zoom in when first putting on the binoculars local min_mod = -10 --how far you can zoom out by scrolling down on the mouse wheel local max_mod = 40 --how far you can zoom in by scrolling up on the mouse wheel function binoculars_init(e) binoc_img = CreateSprite(LoadImage("scriptbank\\images\\binoculars.png")) --where to find the image used to display on screen while using binoculars SetSpritePosition(binoc_img,200,200) SetSpriteSize(binoc_img,100,100) end function binoculars_main(e) if fov == nil then fov = g_PlayerFOV end if g_MouseClick == 2 then SetPlayerFOV(fov-mod) PasteSpritePosition(binoc_img,0,0) if g_MouseWheel < start_wheel then mod = mod - zoom_speed start_wheel = g_MouseWheel elseif g_MouseWheel > start_wheel then mod = mod + zoom_speed start_wheel = g_MouseWheel end if mod < min_mod then mod = min_mod elseif mod > max_mod then mod = max_mod end else mod = init_mod start_wheel = g_MouseWheel SetPlayerFOV(fov) end end function binoculars_exit(e) end