Since you are still using the MouseWheel, unbinding it would not solve your problem.
Since it’s just the in/out zooming of the scroll wheel, we can just set the MaxZoomDistance and MinZoomDistance of the Players’ camera to the current zoom, and change them back after its closed.
Now, getting the current zoom of the Players’ camera isn’t a feature that Roblox has, but it is easily calculated.
local player = game.Players.LocalPlayer -- Get the player (for the camera)
local currentZoom = (workspace.CurrentCamera.CoordinateFrame.p - player.Character.Head.Position).magnitude (calc. currentzoom)
local LastMaxZoom = player.CameraMaxZoomDistance -- save the current settings
local LastMinZoom = player.CameraMinZoomDistance -- ^
local isDisabled = false
function ToggleScroll() -- simple on/off function for the zoomies
if isDisabled then -- Scroll is active
isDisabled = false
player.CameraMaxZoomDistance = LastMaxZoom
player.CameraMinZoomDistance = LastMinZoom
else -- scroll is inactive
isDisabled = true
player.CameraMaxZoomDistance = currentZoom
player.CameraMinZoomDistance = currentZoom
end
end
I know you want to do ContextActionService, but I honestly have no idea what the bind ActionName would be for the in/out on the scroll wheel anyhow. This is probably the only way to go about it right now.