resizeButton.MouseButton1Down:Connect(function()local K=windowFrame.AbsolutePosition local D=windowFrame.AbsoluteSize local C=UserInputService:GetMouseLocation()mouseOffset=Vector2.new((K.X+D.X)-C.X,(K.Y+D.Y)-C.Y)local s=UserInputService.InputChanged:Connect(function(D)if D.UserInputType==Enum.UserInputType.MouseMovement then local D=UserInputService:GetMouseLocation()local C=Vector2.new((D.X-K.X)+mouseOffset.X,(D.Y-K.Y)+mouseOffset.Y)C=Vector2.new(math.clamp(C.X,minSize.X,maxSize.X),math.clamp(C.Y,minSize.Y,maxSize.Y))windowFrame.Size=UDim2.new(0,C.X,0,C.Y)end end)local N N=UserInputService.InputEnded:Connect(function(K)if K.UserInputType==Enum.UserInputType.MouseButton1 then s:Disconnect()N:Disconnect()end end)end)
-- Define the mouse event handlers for resizing the window
resizeButton.MouseButton1Down:Connect(function()
	-- Store the mouse position offset relative to the window position
	local windowPos = windowFrame.AbsolutePosition
	local windowSize = windowFrame.AbsoluteSize
	local mousePos = UserInputService:GetMouseLocation()
	mouseOffset = Vector2.new(windowPos.X + windowSize.X - mousePos.X, windowPos.Y + windowSize.Y - mousePos.Y)

	-- Connect the mouse move and up events for resizing the window
	local mouseMoveConn = UserInputService.InputChanged:Connect(function(input)
		if input.UserInputType == Enum.UserInputType.MouseMovement then
			-- Calculate the new size of the window based on the mouse position
			local mousePos = UserInputService:GetMouseLocation()
			local newSize =
				Vector2.new(mousePos.X - windowPos.X + mouseOffset.X, mousePos.Y - windowPos.Y + mouseOffset.Y)

			-- Constrain the new size of the window to within the minimum and maximum size
			newSize =
				Vector2.new(math.clamp(newSize.X, minSize.X, maxSize.X), math.clamp(newSize.Y, minSize.Y, maxSize.Y))

			-- Update the size of the window
			windowFrame.Size = UDim2.new(0, newSize.X, 0, newSize.Y)
		end
	end)

	local mouseUpConn
	mouseUpConn = UserInputService.InputEnded:Connect(function(input)
		if input.UserInputType == Enum.UserInputType.MouseButton1 then
			-- Disconnect the mouse move and up events for resizing the window
			mouseMoveConn:Disconnect()
			mouseUpConn:Disconnect()
		end
	end)
end)
