canvas.MouseEnter:Connect(function()uis.MouseIconEnabled=false cursor.Visible=true local e=(workspace.CurrentCamera.CFrame.Position-game.Players.LocalPlayer.Character.Head.Position).Magnitude game.Players.LocalPlayer.CameraMinZoomDistance=e game.Players.LocalPlayer.CameraMaxZoomDistance=e end)canvas.MouseLeave:Connect(function()uis.MouseIconEnabled=true cursor.Visible=false game.Players.LocalPlayer.CameraMinZoomDistance=.5 game.Players.LocalPlayer.CameraMaxZoomDistance=128 end)
--Make sure the mouse is on the canvas
canvas.MouseEnter:Connect(function()
	uis.MouseIconEnabled = false
	cursor.Visible = true

	local zoom = (workspace.CurrentCamera.CFrame.Position - game.Players.LocalPlayer.Character.Head.Position).Magnitude
	game.Players.LocalPlayer.CameraMinZoomDistance = zoom
	game.Players.LocalPlayer.CameraMaxZoomDistance = zoom
end)
canvas.MouseLeave:Connect(function()
	uis.MouseIconEnabled = true
	cursor.Visible = false

	game.Players.LocalPlayer.CameraMinZoomDistance = 0.5
	game.Players.LocalPlayer.CameraMaxZoomDistance = 128
end)
