resizeButton.MouseButton1Down:Connect(function()local A=windowFrame.AbsolutePosition local W=windowFrame.AbsoluteSize local X=UserInputService:GetMouseLocation()mouseOffset=Vector2.new((A.X+W.X)-X.X,(A.Y+W.Y)-X.Y)local Z=UserInputService.InputChanged:Connect(function(W)if W.UserInputType==Enum.UserInputType.MouseMovement then local W=UserInputService:GetMouseLocation()local X=Vector2.new((W.X-A.X)+mouseOffset.X,(W.Y-A.Y)+mouseOffset.Y)X=Vector2.new(math.clamp(X.X,minSize.X,maxSize.X),math.clamp(X.Y,minSize.Y,maxSize.Y))windowFrame.Size=UDim2.new(0,X.X,0,X.Y)end end)local p p=UserInputService.InputEnded:Connect(function(A)if A.UserInputType==Enum.UserInputType.MouseButton1 then Z:Disconnect()p:Disconnect()end end)end)

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)
