Temporarily disable scroll to zoom

There are two ways of doing that, you can set the min/max zoom to the current zoom, or use ContextActionService to bind a function that if returns Enum.ContextActionResult.Sink will prevent roblox from scrolling and if return Enum.ContextActionResult.Pass will allow roblox to zoom-in/out.


local ContextActionService = game:GetService("ContextActionService")
local DisableScroll = true

ContextActionService:BindAction("DisableScroll",
	function ()
		return DisableScroll and Enum.ContextActionResult.Sink or Enum.ContextActionResult.Pass
	end, false, Enum.UserInputType.MouseWheel)

Sorry for any typo, Im on phone lol

5 Likes